Backed out changeset fcf7daa94373 (bug 806168)
authorJustin Lebar <justin.lebar@gmail.com>
Tue, 30 Oct 2012 21:35:45 -0400
changeset 111978 2633b018c0a052acab4cb25f8f5c385162990627
parent 111977 8c25f2a7a2f0d323c780a67102352005edccb919
child 111979 df6cbf360b2506a2d7f11d5e0350e1948a3c5788
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
bugs806168
milestone19.0a1
backs outfcf7daa9437367ef9cc4d6b26c776b72cbd3406c
Backed out changeset fcf7daa94373 (bug 806168)
dom/indexedDB/test/Makefile.in
dom/indexedDB/test/test_webapp_clearBrowserData.html
dom/indexedDB/test/test_webapp_clearBrowserData_inproc_inproc.html
dom/indexedDB/test/test_webapp_clearBrowserData_inproc_oop.html
dom/indexedDB/test/test_webapp_clearBrowserData_oop_inproc.html
dom/indexedDB/test/webapp_clearBrowserData.js
dom/indexedDB/test/webapp_clearBrowserData_appFrame.html
dom/indexedDB/test/webapp_clearBrowserData_browserFrame.html
--- a/dom/indexedDB/test/Makefile.in
+++ b/dom/indexedDB/test/Makefile.in
@@ -98,24 +98,21 @@ MOCHITEST_FILES = \
   test_transaction_lifetimes.html \
   test_transaction_lifetimes_nested.html \
   test_transaction_ordering.html \
   test_setVersion.html \
   test_setVersion_abort.html \
   test_setVersion_events.html \
   test_setVersion_exclusion.html \
   test_unique_index_update.html \
-  test_webapp_clearBrowserData_inproc_oop.html \
-  test_webapp_clearBrowserData_oop_inproc.html \
-  test_webapp_clearBrowserData_inproc_inproc.html \
+  test_webapp_clearBrowserData.html \
   third_party_iframe1.html \
   third_party_iframe2.html \
   test_app_isolation_inproc.html \
   test_app_isolation_oop.html \
-  webapp_clearBrowserData.js \
   webapp_clearBrowserData_appFrame.html \
   webapp_clearBrowserData_browserFrame.html \
   $(NULL)
 
 #   test_writer_starvation.html  disabled for infinite loops, bug 595368
 
 ifeq (browser,$(MOZ_BUILD_APP))
 MOCHITEST_BROWSER_FILES = \
rename from dom/indexedDB/test/webapp_clearBrowserData.js
rename to dom/indexedDB/test/test_webapp_clearBrowserData.html
--- a/dom/indexedDB/test/webapp_clearBrowserData.js
+++ b/dom/indexedDB/test/test_webapp_clearBrowserData.html
@@ -1,47 +1,32 @@
-/* Any copyright is dedicated to the Public Domain.
-   http://creativecommons.org/publicdomain/zero/1.0/ */
+<!--
+  Any copyright is dedicated to the Public Domain.
+  http://creativecommons.org/publicdomain/zero/1.0/
+-->
+<html>
+<head>
+  <title>Indexed Database Clear Browser Data Test</title>
 
-// This file has 4 leading spaces so that hg/git can tell that it's copied
-// from test_webapp_clearBrowserData.html.  We'll fix the indentation in
-// the next commit.
+  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
+  <script type="text/javascript;version=1.7">
     "use strict";
 
     const appDomain = "example.org";
     const manifestURL =
       location.protocol + "//" + appDomain + "/manifest.webapp";
 
     function testSteps()
     {
       const objectStoreName = "foo";
       const testKey = 1;
       const testValue = objectStoreName;
 
-      // Determine whether the app and browser frames should be in or
-      // out-of-process.
-      let remote_app, remote_browser;
-      if (window.location.href.indexOf("inproc_oop") != -1) {
-        remote_app = false;
-        remote_browser = true;
-      }
-      else if (window.location.href.indexOf("oop_inproc") != -1) {
-        remote_app = true;
-        remote_browser = false;
-      }
-      else if (window.location.href.indexOf("inproc_inproc") != -1) {
-        remote_app = false;
-        remote_browser = false;
-      }
-      else {
-        ok(false, "Bad test filename!");
-        return;
-      }
-
       let request = indexedDB.open(window.location.pathname, 1);
       request.onerror = errorHandler;
       request.onupgradeneeded = grabEventAndContinueHandler;
       request.onsuccess = unexpectedSuccessHandler;
       let event = yield;
 
       let db = event.target.result;
       db.onerror = errorHandler;
@@ -50,33 +35,26 @@
       }
 
       let objectStore = db.createObjectStore(objectStoreName);
       objectStore.add(testValue, testKey);
 
       request.onsuccess = grabEventAndContinueHandler;
       event = yield;
 
-      // We need to send both remote_browser and remote_app in the querystring
-      // because webapp_clearBrowserData_appFrame uses the path + querystring to
-      // create and open a database which it checks no other test has touched.  If
-      // we sent only remote_browser, then we wouldn't be able to test both
-      // (remote_app==false, remote_browser==false) and (remote_app==true,
-      // remote_browser==false).
-      let srcURL = location.protocol + "//" + appDomain +
-        location.pathname.substring(0, location.pathname.lastIndexOf('/')) +
-        "/webapp_clearBrowserData_appFrame.html?" +
-        "remote_browser=" + remote_browser + "&" +
-        "remote_app=" + remote_app;
+      let srcURL =
+        location.protocol + "//" + appDomain +
+        location.pathname.replace("test_webapp_clearBrowserData.html",
+                                  "webapp_clearBrowserData_appFrame.html");
 
       let iframe = document.createElement("iframe");
       iframe.setAttribute("mozbrowser", "");
       iframe.setAttribute("mozapp", manifestURL);
       iframe.setAttribute("src", srcURL);
-      iframe.setAttribute("remote", remote_app);
+      iframe.setAttribute("remote", "true");
       iframe.addEventListener("mozbrowsershowmodalprompt", function(event) {
         let message = JSON.parse(event.detail.message);
         switch (message.type) {
           case "info":
           case "ok":
             window[message.type].apply(window, message.args);
             break;
           case "done":
@@ -144,8 +122,16 @@
           appRegistry.allAppsLaunchable = originalAllAppsLaunchable;
         }
       }, false);
 
       SpecialPowers.pushPrefEnv({
         "set": [["dom.mozBrowserFramesEnabled", true]]
       }, runTest);
     }
+  </script>
+
+  <script type="text/javascript;version=1.7" src="helpers.js"></script>
+</head>
+
+<body onload="start();"></body>
+
+</html>
deleted file mode 100644
--- a/dom/indexedDB/test/test_webapp_clearBrowserData_inproc_inproc.html
+++ /dev/null
@@ -1,33 +0,0 @@
-<!--
-  Any copyright is dedicated to the Public Domain.
-  http://creativecommons.org/publicdomain/zero/1.0/
--->
-
-<!--
-  We have three similar tests here which each check that indexedDB data for a
-  browser inside an app is cleared upon request:
-
-    1) test_webapp_clearBrowserData_inproc_oop.html,
-    2) test_webapp_clearBrowserData_oop_inproc.html, and
-    3) test_webapp_clearBrowserData_inproc_inproc.html.
-
-  The only difference between these is that the first constructs an in-process
-  app frame which contains an out-of-process browser frame, the second
-  constructs an out-of-process app frame which contains an in-process browser
-  frame, and the third has both frames in process.
-
-  The tests share all their JS code.  webapp_clearBrowserData.js determines
-  which frames are in- and out-of-process by looking at the test's filename.
--->
-
-<html>
-<head>
-  <title>Indexed Database Clear Browser Data Test inproc/inproc</title>
-  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-  <script type="text/javascript;version=1.7" src="webapp_clearBrowserData.js"></script>
-  <script type="text/javascript;version=1.7" src="helpers.js"></script>
-</head>
-<body onload="start();">
-</body>
-</html>
deleted file mode 100644
--- a/dom/indexedDB/test/test_webapp_clearBrowserData_inproc_oop.html
+++ /dev/null
@@ -1,21 +0,0 @@
-<!--
-  Any copyright is dedicated to the Public Domain.
-  http://creativecommons.org/publicdomain/zero/1.0/
--->
-
-<!--
-  See comment in test_webapp_clearBrowserData_inproc_inproc.html for an
-  explanation of what's going on here.
--->
-
-<html>
-<head>
-  <title>Indexed Database Clear Browser Data Test inproc/oop</title>
-  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <script type="text/javascript;version=1.7" src="webapp_clearBrowserData.js"></script>
-  <script type="text/javascript;version=1.7" src="helpers.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body onload="start();">
-</body>
-</html>
deleted file mode 100644
--- a/dom/indexedDB/test/test_webapp_clearBrowserData_oop_inproc.html
+++ /dev/null
@@ -1,21 +0,0 @@
-<!--
-  Any copyright is dedicated to the Public Domain.
-  http://creativecommons.org/publicdomain/zero/1.0/
--->
-
-<!--
-  See comment in test_webapp_clearBrowserData_inproc_inproc.html for an
-  explanation of what's going on here.
--->
-
-<html>
-<head>
-  <title>Indexed Database Clear Browser Data Test oop/inproc</title>
-  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <script type="text/javascript;version=1.7" src="webapp_clearBrowserData.js"></script>
-  <script type="text/javascript;version=1.7" src="helpers.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body onload="start();">
-</body>
-</html>
--- a/dom/indexedDB/test/webapp_clearBrowserData_appFrame.html
+++ b/dom/indexedDB/test/webapp_clearBrowserData_appFrame.html
@@ -28,33 +28,18 @@
 
     window.onerror = ok.bind(window, false);
 
     function testSteps()
     {
       const objectStoreName = "foo";
       const testKey = 1;
       const testValue = objectStoreName;
-      const dbName = location.pathname + location.search;
 
-      // Determine whether our parent iframe asked us to create a remote
-      // browser frame here.
-      let remote_browser;
-      if (location.search.indexOf("remote_browser=true") != -1) {
-        remote_browser = true;
-      }
-      else if (location.search.indexOf("remote_browser=false") != -1) {
-        remote_browser = false;
-      }
-      else {
-        ok(false, "Expected remote_browser={true,false} in query string.");
-        return;
-      }
-
-      let request = indexedDB.open(dbName, 1);
+      let request = indexedDB.open(window.location.pathname, 1);
       request.onerror = errorHandler;
       request.onupgradeneeded = grabEventAndContinueHandler;
       request.onsuccess = unexpectedSuccessHandler;
       let event = yield;
 
       let db = event.target.result;
       db.onerror = errorHandler;
       db.onversionchange = function(event) {
@@ -73,21 +58,17 @@
         db.transaction(objectStoreName).objectStore(objectStoreName);
       objectStore.get(testKey).onsuccess = grabEventAndContinueHandler;
       event = yield;
 
       ok(testValue == event.target.result, "data exists");
 
       let iframe = document.createElement("iframe");
       iframe.setAttribute("mozbrowser", "");
-      // Send our querystring to the subframe because
-      // webapp_clearBrowserData_browserFrame uses its pathname + querystring to
-      // open a database which it assumes hasn't been touched by another test.
-      iframe.setAttribute("src", "webapp_clearBrowserData_browserFrame.html" + location.search);
-      iframe.setAttribute("remote", remote_browser);
+      iframe.setAttribute("src", "webapp_clearBrowserData_browserFrame.html");
       iframe.addEventListener("mozbrowsershowmodalprompt", function(event) {
         let message = JSON.parse(event.detail.message);
         switch (message.type) {
           case "block":
             info("blocking browserFrame");
             event.preventDefault();
 
             let request = navigator.mozApps.getSelf();
@@ -110,17 +91,17 @@
         }
       });
 
       info("loading browser frame");
 
       document.body.appendChild(iframe);
       yield;
 
-      request = indexedDB.open(dbName, 1);
+      request = indexedDB.open(window.location.pathname, 1);
       request.onerror = errorHandler;
       request.onupgradeneeded = unexpectedSuccessHandler;
       request.onsuccess = grabEventAndContinueHandler;
       event = yield;
 
       db = event.target.result;
       db.onerror = errorHandler;
 
--- a/dom/indexedDB/test/webapp_clearBrowserData_browserFrame.html
+++ b/dom/indexedDB/test/webapp_clearBrowserData_browserFrame.html
@@ -38,19 +38,18 @@
 
     window.onerror = ok.bind(window, false);
 
     function testSteps()
     {
       const objectStoreName = "foo";
       const testKey = 1;
       const testValue = objectStoreName;
-      const dbName = window.location.pathname + window.location.search;
 
-      let request = indexedDB.open(dbName, 1);
+      let request = indexedDB.open(window.location.pathname, 1);
       request.onerror = errorHandler;
       request.onupgradeneeded = grabEventAndContinueHandler;
       request.onsuccess = unexpectedSuccessHandler;
       let event = yield;
 
       let db = event.target.result;
       db.onerror = errorHandler;
       db.onversionchange = function(event) {
@@ -69,17 +68,17 @@
         db.transaction(objectStoreName).objectStore(objectStoreName);
       objectStore.get(testKey).onsuccess = grabEventAndContinueHandler;
       event = yield;
 
       ok(testValue == event.target.result, "data exists");
 
       block();
 
-      request = indexedDB.open(dbName, 1);
+      request = indexedDB.open(window.location.pathname, 1);
       request.onerror = errorHandler;
       request.onupgradeneeded = grabEventAndContinueHandler;
       request.onsuccess = unexpectedSuccessHandler;
       event = yield;
 
       ok(event.type == "upgradeneeded", "db doesn't exist");
 
       request.onsuccess = grabEventAndContinueHandler;