blob: 268ed72e935dc80818e85f7756785ac4ca5b001c [file] [log] [blame]
<!DOCTYPE html>
<meta charset="utf-8">
<title>IDBObjectStore.add() - If the transaction this IDBObjectStore belongs to has its mode set to readonly, throw ReadOnlyError </title>
<link rel="author" title="Intel" href="">
<link rel="help" href="">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support.js"></script>
<div id="log"></div>
var db,
t = async_test();
var open_rq = createdb(t);
open_rq.onupgradeneeded = function (event) {
db =;
db.createObjectStore("store", {keyPath:"pKey"});
open_rq.onsuccess = function (event) {
var txn = db.transaction("store");
var ostore = txn.objectStore("store");
assert_throws("ReadOnlyError", function(){
ostore.add({ pKey: "primaryKey_0"});