Changeset 65807 in webkit
- Timestamp:
- Aug 23, 2010, 6:23:05 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 3 deleted
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r65800 r65807 1 2010-08-19 Jeremy Orlow <jorlow@chromium.org> 2 3 Reviewed by Steve Block. 4 5 Remove IDBDatabase.description per spec changes 6 https://bugs.webkit.org/show_bug.cgi?id=44264 7 8 Update layout tests to match changes. One layout test is now 9 obsolete. 10 11 * storage/indexeddb/database-basics-expected.txt: 12 * storage/indexeddb/database-description-expected.txt: Removed. 13 * storage/indexeddb/database-description.html: Removed. 14 * storage/indexeddb/script-tests/database-basics.js: 15 (openSuccess): 16 * storage/indexeddb/script-tests/database-description.js: Removed. 17 1 18 2010-08-23 Roland Steiner <rolandsteiner@chromium.org> 2 19 -
trunk/LayoutTests/storage/indexeddb/database-basics-expected.txt
r64053 r65807 25 25 db = event.result 26 26 PASS db.name is "name" 27 PASS db.description is "description"28 27 PASS db.version is "" 29 28 PASS db.objectStores is [] -
trunk/LayoutTests/storage/indexeddb/script-tests/database-basics.js
r64053 r65807 9 9 var db = evalAndLog("db = event.result"); 10 10 shouldBeEqualToString("db.name", "name"); 11 shouldBeEqualToString("db.description", "description");12 11 shouldBeEqualToString("db.version", ""); 13 12 shouldBe("db.objectStores", "[]"); -
trunk/WebCore/ChangeLog
r65806 r65807 1 2010-08-19 Jeremy Orlow <jorlow@chromium.org> 2 3 Reviewed by Steve Block. 4 5 Remove IDBDatabase.description per spec changes 6 https://bugs.webkit.org/show_bug.cgi?id=44264 7 8 There's now no longer any way to access the description from JS. 9 The main premise of the manual test is now obsolete. Over time we'll 10 be able to add to it again. While I'm at it, I cleaned up the format 11 of the manual test to be easier to follow (code and usage wise). 12 13 * manual-tests/indexed-database.html: 14 * storage/IDBDatabase.cpp: 15 (WebCore::IDBDatabase::IDBDatabase): 16 * storage/IDBDatabase.h: 17 * storage/IDBDatabase.idl: 18 1 19 2010-08-23 Pavel Feldman <pfeldman@chromium.org> 2 20 -
trunk/WebCore/manual-tests/indexed-database.html
r65667 r65807 3 3 <p>This is a test that only applies to IndexedDB. <span id=enabled>Our test for whether you have it enabled seems to have failed.</span></p> 4 4 5 <p> This page opens up a database with the name "name" and a description of "description". Result of open: <span id=result>Pending...</span></p>5 <p>Please follow these steps in order:</p> 6 6 7 <p>The first time you open this page up, the message should be a success. Now, lets make it fail. Find where the associated .indexeddb file is 8 for this page, replace it with something that's not a sqlite database, and make it read only to your user. Now close and re-open the browser. 9 When you re-open it, you should get an internal error from the page.</p> 7 <p>First, click <a href="javascript: doOpen(true)">here</a> to open an indexedDB database. Look in the proper place in your file system (the place being specific to each port) and verify a file was created. You should be able to open the file up with sqlite and examine it that way as well.</p> 10 8 11 <p>N ow delete all IndexedDB files (including the one you just made), restart the browser, and come back to this page. It should start up fine again.</p>9 <p>Next, close the browser, delete the file, replace it with some garbage, and make it read only to the user the browser is running as. Now click <a href="javascript: doOpen(false)">here</a>. You should get some sort of error.</p> 12 10 13 <p> Now click <a href="javascript:updateDescription()">here</a>, close the browser, come back, and click <a href="javascript:readDescription()">here</a>. If everything worked well, this should be a success here: <span id=description>...</span></p>11 <p>Close the browser, delete the file you made, and click <a href="javascript: doOpen(true)">here</a>. All should be well again.</p> 14 12 15 <p> That's it!</p>13 <p>Status: <span id=status>...</span></p> 16 14 17 15 <script> 18 16 19 readyCount = 0; 17 if (!('indexedDB' in window)) 18 document.getElementById("enabled").innerHTML = "<font color=red>Your build does NOT seem to have it enabled. So all code on this page is disabled.</font>"; 19 else 20 document.getElementById("enabled").innerHTML = "<font color=green>Your build seems to have it enabled.</font>"; 20 21 21 if (!('indexedDB' in window)) 22 document.getElementById("enabled").innerHTML = "<font color=red>Your build does NOT seem to have it enabled. So all code on this page is disabled.</font>"; 23 else { 24 document.getElementById("enabled").innerHTML = "<font color=green>Your build seems to have it enabled.</font>"; 22 function status(str, color) 23 { 24 if (color) 25 str = "<font color='" + color + "'>" + str + "</font>"; 26 document.getElementById("status").innerHTML = str; 27 } 25 28 26 request = indexedDB.open("name"); 27 request.onsuccess = function() { 28 document.getElementById("result").innerHTML = "<font color=green>Success!</font>"; 29 window.nameDB = event.result; 30 ++readyCount; 31 }; 32 request.onerror = function() { 33 document.getElementById("result").innerHTML = "<font color=red>Error: " + event.message + ".</font>"; 34 }; 35 36 request = indexedDB.open("another", "test of the description attribute"); 37 request.onsuccess = function() { 38 window.anotherDB = event.result; 39 ++readyCount; 40 }; 41 } 42 43 function updateDescription() 44 { 45 if (readCount < 2) { 46 alert("The page has not finished loading. Hold on a sec..."); 47 return; 48 } 49 50 indexedDB.open("name", "test of the description attribute"); 51 indexedDB.open("another", "xyz"); 52 } 53 54 function readDescription() 55 { 56 if (readCount < 2) { 57 alert("The page has not finished loading. Hold on a sec..."); 58 return; 59 } 60 61 if (window.nameDB.description != "test of the description attribute") { 62 // Since we passed in nothing, the description should not be reset. 63 document.getElementById("description").innerHTML = "<font color=red>Failure: (Database 'name' was this: " + window.nameDB.description + ").</font>"; 64 } else if (window.anotherDB.description != "test of the description attribute") { 65 // But in this case we did pass something in, so it should have been reset. 66 document.getElementById("description").innerHTML = "<font color=red>Failure: (Database 'another' was this: " + window.anotherDB.description + ").</font>"; 67 } else { 68 request = indexedDB.open("another", "123"); 69 request.onsuccess = function() { 70 // And here it should have been reset again. 71 if (event.result.description != "123") 72 document.getElementById("description").innerHTML = "<font color=red>Failure: (Database 'another' was this: " + event.result.description + ").</font>"; 73 else 74 document.getElementById("description").innerHTML = "<font color=green>Success!</font>"; 75 }; 76 } 77 } 29 function doOpen(expectSuccess) 30 { 31 status("Calling open"); 32 request = indexedDB.open("xyz"); 33 request.onsuccess = function() { 34 if (expectSuccess) 35 status("Open successful", "green"); 36 else 37 status("Open was successful...but shouldn't have been", "red"); 38 }; 39 request.onerror = function() { 40 if (expectSuccess) 41 status("Unexpected error: " + event.message, "red"); 42 else 43 status("Expected error: " + event.message, "green"); 44 }; 45 } 78 46 79 47 </script> -
trunk/WebCore/storage/IDBDatabase.cpp
r65670 r65807 40 40 IDBDatabase::IDBDatabase(PassRefPtr<IDBDatabaseBackendInterface> backend) 41 41 : m_backend(backend) 42 , m_description(m_backend->description())43 42 { 44 43 // We pass a reference to this object before it can be adopted. -
trunk/WebCore/storage/IDBDatabase.h
r65509 r65807 53 53 // Implement the IDL 54 54 String name() const { return m_backend->name(); } 55 String description() const { return m_description; }56 55 String version() const { return m_backend->version(); } 57 56 PassRefPtr<DOMStringList> objectStores() const { return m_backend->objectStores(); } … … 66 65 67 66 RefPtr<IDBDatabaseBackendInterface> m_backend; 68 69 String m_description;70 67 }; 71 68 -
trunk/WebCore/storage/IDBDatabase.idl
r64824 r65807 30 30 ] IDBDatabase { 31 31 readonly attribute DOMString name; 32 readonly attribute DOMString description;33 32 readonly attribute DOMString version; 34 33 readonly attribute DOMStringList objectStores;
Note:
See TracChangeset
for help on using the changeset viewer.