Changeset 65807 in webkit


Ignore:
Timestamp:
Aug 23, 2010 6:23:05 AM (14 years ago)
Author:
jorlow@chromium.org
Message:

2010-08-19 Jeremy Orlow <jorlow@chromium.org>

Reviewed by Steve Block.

Remove IDBDatabase.description per spec changes
https://bugs.webkit.org/show_bug.cgi?id=44264

Update layout tests to match changes. One layout test is now
obsolete.

  • storage/indexeddb/database-basics-expected.txt:
  • storage/indexeddb/database-description-expected.txt: Removed.
  • storage/indexeddb/database-description.html: Removed.
  • storage/indexeddb/script-tests/database-basics.js: (openSuccess):
  • storage/indexeddb/script-tests/database-description.js: Removed.

2010-08-19 Jeremy Orlow <jorlow@chromium.org>

Reviewed by Steve Block.

Remove IDBDatabase.description per spec changes
https://bugs.webkit.org/show_bug.cgi?id=44264

There's now no longer any way to access the description from JS.
The main premise of the manual test is now obsolete. Over time we'll
be able to add to it again. While I'm at it, I cleaned up the format
of the manual test to be easier to follow (code and usage wise).

  • manual-tests/indexed-database.html:
  • storage/IDBDatabase.cpp: (WebCore::IDBDatabase::IDBDatabase):
  • storage/IDBDatabase.h:
  • storage/IDBDatabase.idl:
Location:
trunk
Files:
3 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r65800 r65807  
     12010-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
    1182010-08-23  Roland Steiner  <rolandsteiner@chromium.org>
    219
  • trunk/LayoutTests/storage/indexeddb/database-basics-expected.txt

    r64053 r65807  
    2525db = event.result
    2626PASS db.name is "name"
    27 PASS db.description is "description"
    2827PASS db.version is ""
    2928PASS db.objectStores is []
  • trunk/LayoutTests/storage/indexeddb/script-tests/database-basics.js

    r64053 r65807  
    99    var db = evalAndLog("db = event.result");
    1010    shouldBeEqualToString("db.name", "name");
    11     shouldBeEqualToString("db.description", "description");
    1211    shouldBeEqualToString("db.version", "");
    1312    shouldBe("db.objectStores", "[]");
  • trunk/WebCore/ChangeLog

    r65806 r65807  
     12010-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
    1192010-08-23  Pavel Feldman  <pfeldman@chromium.org>
    220
  • trunk/WebCore/manual-tests/indexed-database.html

    r65667 r65807  
    33<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>
    44
    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>
    66
    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>
    108
    11 <p>Now 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>
    1210
    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>
    1412
    15 <p>That's it!</p>
     13<p>Status: <span id=status>...</span></p>
    1614
    1715<script>
    1816
    19     readyCount = 0;
     17if (!('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>";
     19else
     20    document.getElementById("enabled").innerHTML = "<font color=green>Your build seems to have it enabled.</font>";
    2021
    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>";
     22function status(str, color)
     23{
     24    if (color)
     25        str = "<font color='" + color + "'>" + str + "</font>";
     26    document.getElementById("status").innerHTML = str;
     27}
    2528
    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     }
     29function 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}
    7846
    7947</script>
  • trunk/WebCore/storage/IDBDatabase.cpp

    r65670 r65807  
    4040IDBDatabase::IDBDatabase(PassRefPtr<IDBDatabaseBackendInterface> backend)
    4141    : m_backend(backend)
    42     , m_description(m_backend->description())
    4342{
    4443    // We pass a reference to this object before it can be adopted.
  • trunk/WebCore/storage/IDBDatabase.h

    r65509 r65807  
    5353    // Implement the IDL
    5454    String name() const { return m_backend->name(); }
    55     String description() const { return m_description; }
    5655    String version() const { return m_backend->version(); }
    5756    PassRefPtr<DOMStringList> objectStores() const { return m_backend->objectStores(); }
     
    6665
    6766    RefPtr<IDBDatabaseBackendInterface> m_backend;
    68 
    69     String m_description;
    7067};
    7168
  • trunk/WebCore/storage/IDBDatabase.idl

    r64824 r65807  
    3030    ] IDBDatabase {
    3131        readonly attribute DOMString name;
    32         readonly attribute DOMString description;
    3332        readonly attribute DOMString version;
    3433        readonly attribute DOMStringList objectStores;
Note: See TracChangeset for help on using the changeset viewer.