diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-12-22 01:23:56 +0100 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-12-22 01:26:49 +0100 |
commit | 54091ecab46c93c2e1b2c689e9179a980beaabe6 (patch) | |
tree | 5cead66d889007e1b06c5dbb8e3d37b2538d0557 /dom/tests | |
parent | c1013e9122456b342d65e4eb4c38a7281d8d83d2 (diff) | |
parent | 492624a7106ecbc18994b465ca1dd23fa472bf7e (diff) | |
download | UXP-54091ecab46c93c2e1b2c689e9179a980beaabe6.tar UXP-54091ecab46c93c2e1b2c689e9179a980beaabe6.tar.gz UXP-54091ecab46c93c2e1b2c689e9179a980beaabe6.tar.lz UXP-54091ecab46c93c2e1b2c689e9179a980beaabe6.tar.xz UXP-54091ecab46c93c2e1b2c689e9179a980beaabe6.zip |
Forward to new tree structure.
Diffstat (limited to 'dom/tests')
-rw-r--r-- | dom/tests/mochitest/ajax/offline/mochitest.ini | 2 | ||||
-rw-r--r-- | dom/tests/mochitest/ajax/offline/test_lowDeviceStorage.html | 91 | ||||
-rw-r--r-- | dom/tests/mochitest/ajax/offline/test_lowDeviceStorageDuringUpdate.html | 58 | ||||
-rw-r--r-- | dom/tests/mochitest/bugs/iframe_bug38959-1.html | 14 | ||||
-rw-r--r-- | dom/tests/mochitest/bugs/iframe_bug38959-2.html | 14 | ||||
-rw-r--r-- | dom/tests/mochitest/bugs/mochitest.ini | 3 | ||||
-rw-r--r-- | dom/tests/mochitest/bugs/test_bug38959.html | 57 | ||||
-rw-r--r-- | dom/tests/mochitest/chrome/queryCaretRectWin.html | 2 | ||||
-rw-r--r-- | dom/tests/mochitest/chrome/selectAtPoint.html | 12 | ||||
-rw-r--r-- | dom/tests/mochitest/localstorage/mochitest.ini | 1 | ||||
-rw-r--r-- | dom/tests/mochitest/localstorage/test_lowDeviceStorage.html | 76 |
11 files changed, 4 insertions, 326 deletions
diff --git a/dom/tests/mochitest/ajax/offline/mochitest.ini b/dom/tests/mochitest/ajax/offline/mochitest.ini index 961b143b6..45909e94e 100644 --- a/dom/tests/mochitest/ajax/offline/mochitest.ini +++ b/dom/tests/mochitest/ajax/offline/mochitest.ini @@ -79,8 +79,6 @@ support-files = [test_fallback.html] [test_foreign.html] [test_identicalManifest.html] -[test_lowDeviceStorage.html] -[test_lowDeviceStorageDuringUpdate.html] [test_missingFile.html] [test_missingManifest.html] [test_noManifest.html] diff --git a/dom/tests/mochitest/ajax/offline/test_lowDeviceStorage.html b/dom/tests/mochitest/ajax/offline/test_lowDeviceStorage.html deleted file mode 100644 index d03ef5a12..000000000 --- a/dom/tests/mochitest/ajax/offline/test_lowDeviceStorage.html +++ /dev/null @@ -1,91 +0,0 @@ -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<title>Low device storage</title> - -<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> -<script type="text/javascript" src="/tests/dom/tests/mochitest/ajax/offline/offlineTests.js"></script> -<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> - -<script type="text/javascript"> - -/** - * This test checks that an offline cache update scheduled *after* a low device - * storage situation appears is canceled. It basically does: - * - * 1. Notifies to the offline cache update service about a fake - * low device storage situation. - * 2. Schedules an update and observes for its notifications. - * 3. We are supposed to receive an error event notifying about the cancelation - * of the update because of the low storage situation. - * 4. Notifies to the offline cache update service that we've recovered from - * the low storage situation. - */ - -var updateService = SpecialPowers.Cc['@mozilla.org/offlinecacheupdate-service;1'] - .getService(Ci.nsIOfflineCacheUpdateService); - -var obs = SpecialPowers.Cc["@mozilla.org/observer-service;1"] - .getService(SpecialPowers.Ci.nsIObserverService); - -var errorReceived = false; - -var systemPrincipal = SpecialPowers.Services.scriptSecurityManager.getSystemPrincipal(); - -function finish() { - obs.notifyObservers(updateService, "disk-space-watcher", "free"); - - OfflineTest.teardownAndFinish(); -} - -if (OfflineTest.setup()) { - obs.notifyObservers(updateService, "disk-space-watcher", "full"); - - var updateObserver = { - updateStateChanged: function (aUpdate, aState) { - switch(aState) { - case Ci.nsIOfflineCacheUpdateObserver.STATE_ERROR: - errorReceived = true; - OfflineTest.ok(true, "Expected error. Update canceled"); - break; - case Ci.nsIOfflineCacheUpdateObserver.STATE_FINISHED: - aUpdate.removeObserver(this); - OfflineTest.ok(errorReceived, - "Finished after receiving the expected error"); - finish(); - break; - case Ci.nsIOfflineCacheUpdateObserver.STATE_NOUPDATE: - aUpdate.removeObserver(this); - OfflineTest.ok(false, "No update"); - finish(); - break; - case Ci.nsIOfflineCacheUpdateObserver.STATE_DOWNLOADING: - case Ci.nsIOfflineCacheUpdateObserver.STATE_ITEMSTARTED: - case Ci.nsIOfflineCacheUpdateObserver.STATE_ITEMPROGRESS: - aUpdate.removeObserver(this); - OfflineTest.ok(false, "The update was supposed to be canceled"); - finish(); - break; - } - }, - applicationCacheAvailable: function() {} - }; - - var manifest = "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest"; - var ioService = Cc["@mozilla.org/network/io-service;1"] - .getService(Ci.nsIIOService); - var manifestURI = ioService.newURI(manifest, null, null); - var documentURI = ioService.newURI(document.documentURI, null, null); - var update = updateService.scheduleUpdate(manifestURI, documentURI, systemPrincipal, window); - update.addObserver(updateObserver, false); -} - -SimpleTest.waitForExplicitFinish(); - -</script> - -</head> - -<body> - -</body> -</html> diff --git a/dom/tests/mochitest/ajax/offline/test_lowDeviceStorageDuringUpdate.html b/dom/tests/mochitest/ajax/offline/test_lowDeviceStorageDuringUpdate.html deleted file mode 100644 index 88a0b4eae..000000000 --- a/dom/tests/mochitest/ajax/offline/test_lowDeviceStorageDuringUpdate.html +++ /dev/null @@ -1,58 +0,0 @@ -<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest"> -<head> -<title>Low device storage during update</title> - -<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> -<script type="text/javascript" src="/tests/dom/tests/mochitest/ajax/offline/offlineTests.js"></script> -<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> - -<script type="text/javascript"> - -/** - * This test checks that an offline cache update is canceled when a low device - * storage condition is detected during the update. - */ - -var updateService = Cc['@mozilla.org/offlinecacheupdate-service;1'] - .getService(Ci.nsIOfflineCacheUpdateService); - -var obs = SpecialPowers.Cc["@mozilla.org/observer-service;1"] - .getService(SpecialPowers.Ci.nsIObserverService); - -function finish() { - obs.notifyObservers(updateService, "disk-space-watcher", "free"); - - OfflineTest.teardownAndFinish(); -} - -function onError() { - OfflineTest.ok(true, "Expected error: Update canceled"); - finish(); -} - -function onUnexpectedEvent() { - OfflineTest.ok(false, "The update was supposed to be canceled"); - finish(); -} - -function onChecking() { - obs.notifyObservers(updateService, "disk-space-watcher", "full"); -} - -if (OfflineTest.setup()) { - applicationCache.onerror = OfflineTest.priv(onError); - applicationCache.onprogress = OfflineTest.priv(onUnexpectedEvent); - applicationCache.oncached = OfflineTest.priv(onUnexpectedEvent); - applicationCache.onchecking = OfflineTest.priv(onChecking); -} - -SimpleTest.waitForExplicitFinish(); - -</script> - -</head> - -<body> - -</body> -</html> diff --git a/dom/tests/mochitest/bugs/iframe_bug38959-1.html b/dom/tests/mochitest/bugs/iframe_bug38959-1.html deleted file mode 100644 index d4c16c47a..000000000 --- a/dom/tests/mochitest/bugs/iframe_bug38959-1.html +++ /dev/null @@ -1,14 +0,0 @@ -<html> -<head> - <title>Iframe test for bug 38959</title> -</head> -<body"> -<script> - -x = false; -window.opener.postMessage(1, "http://mochi.test:8888"); -window.close(); - -</script> -</body> -</html> diff --git a/dom/tests/mochitest/bugs/iframe_bug38959-2.html b/dom/tests/mochitest/bugs/iframe_bug38959-2.html deleted file mode 100644 index 36cd0c156..000000000 --- a/dom/tests/mochitest/bugs/iframe_bug38959-2.html +++ /dev/null @@ -1,14 +0,0 @@ -<html> -<head> - <title>Iframe test for bug 38959</title> -</head> -<body"> -<script> - -x = true; -window.opener.postMessage(2, "http://mochi.test:8888"); -window.close(); - -</script> -</body> -</html> diff --git a/dom/tests/mochitest/bugs/mochitest.ini b/dom/tests/mochitest/bugs/mochitest.ini index e0c71f857..309aab6e0 100644 --- a/dom/tests/mochitest/bugs/mochitest.ini +++ b/dom/tests/mochitest/bugs/mochitest.ini @@ -23,8 +23,6 @@ support-files = grandchild_bug260264.html iframe_bug304459-1.html iframe_bug304459-2.html - iframe_bug38959-1.html - iframe_bug38959-2.html iframe_bug430276-2.html iframe_bug430276.html iframe_bug440572.html @@ -64,7 +62,6 @@ skip-if = toolkit == 'android' #TIMED_OUT [test_bug377539.html] [test_bug384122.html] [test_bug389366.html] -[test_bug38959.html] [test_bug393974.html] [test_bug394769.html] [test_bug396843.html] diff --git a/dom/tests/mochitest/bugs/test_bug38959.html b/dom/tests/mochitest/bugs/test_bug38959.html deleted file mode 100644 index a8d07d1a6..000000000 --- a/dom/tests/mochitest/bugs/test_bug38959.html +++ /dev/null @@ -1,57 +0,0 @@ -<!DOCTYPE HTML> -<html> -<!-- -https://bugzilla.mozilla.org/show_bug.cgi?id=38959 ---> -<head> - <title>Test for Bug 38959</title> - <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> - <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> -</head> -<body> -<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=38959">Mozilla Bug 38959</a> -<p id="display"></p> -<div id="content" style="display: none"> - <iframe id="frame"></iframe> -</div> -<pre id="test"> -<script type="application/javascript"> - -/** Test for Bug 38959 **/ - -var newValue; - -function watcher(id, ol, ne) -{ - newValue = ne; - return ne; -} - -function openWindow(url, crossOrigin) -{ - newValue = true; - var w = window.open(url); - w.watch("x", watcher); -} - -function receiveMessage(evt) -{ - ok(newValue, "Watchpoints only allowed same-origin."); - if (evt.data == 1) { - openWindow("/tests/dom/tests/mochitest/bugs/iframe_bug38959-2.html"); - } - else { - SimpleTest.finish(); - } -} - -SimpleTest.waitForExplicitFinish(); - -window.addEventListener("message", receiveMessage, false); - -openWindow("http://example.org/tests/dom/tests/mochitest/bugs/iframe_bug38959-1.html"); - -</script> -</pre> -</body> -</html> diff --git a/dom/tests/mochitest/chrome/queryCaretRectWin.html b/dom/tests/mochitest/chrome/queryCaretRectWin.html index cd5a8ec64..cb2fe78a1 100644 --- a/dom/tests/mochitest/chrome/queryCaretRectWin.html +++ b/dom/tests/mochitest/chrome/queryCaretRectWin.html @@ -20,7 +20,7 @@ left: 0em;
top: 0em;
font-size: 10pt;
- font-family: monospace;
+ font-family: 'Courier New';
line-height: 20px;
letter-spacing: 0px;
margin-top:-1px; /* nix the text area border */
diff --git a/dom/tests/mochitest/chrome/selectAtPoint.html b/dom/tests/mochitest/chrome/selectAtPoint.html index 8c625e6f7..6326b500f 100644 --- a/dom/tests/mochitest/chrome/selectAtPoint.html +++ b/dom/tests/mochitest/chrome/selectAtPoint.html @@ -127,13 +127,7 @@ targetPoint = { xPos: rect.left + ((charDims.width * 4) + (charDims.width / 2)), yPos: rect.top + (charDims.height / 2) }; setEnd(dwu, targetPoint.xPos, targetPoint.yPos, Ci.nsIDOMWindowUtils.SELECT_CHARACTER); - if (isLinux || isMac) { - // XXX I think this is a bug, the right hand selection is 4.5 characters over with a - // monspaced font. what we want: t(te)s(ts)election1 what we get: t(te)st(se)lection1 - checkSelection(document, "split selection", "tese"); - } else if (isWindows) { - checkSelection(document, "split selection", "tets"); - } + checkSelection(document, "split selection", "tets"); // Trying to select where there's no text, should fail but not throw let result = dwu.selectAtPoint(rect.left - 20, rect.top - 20, Ci.nsIDOMWindowUtils.SELECT_CHARACTER, false); @@ -228,7 +222,7 @@ <style type="text/css"> body { - font-family: monospace; + font-family: 'Courier New'; margin-left: 40px; margin-top: 40px; padding: 0; @@ -267,7 +261,7 @@ body { <br /> -<iframe id="frame1" src="data:text/html,<html><body style='margin: 0; padding: 0; font-family: monospace;' onload='window.parent.onFrameLoad();'><div id='sel2'>ttestselection2 Lorem ipsum dolor sit amet, at duo debet graeci, vivendum vulputate per ut.</div><br/><br/></body></html>"></iframe> +<iframe id="frame1" src="data:text/html,<html><body style='margin: 0; padding: 0; font-family: \'Courier New\';' onload='window.parent.onFrameLoad();'><div id='sel2'>ttestselection2 Lorem ipsum dolor sit amet, at duo debet graeci, vivendum vulputate per ut.</div><br/><br/></body></html>"></iframe> <br/> diff --git a/dom/tests/mochitest/localstorage/mochitest.ini b/dom/tests/mochitest/localstorage/mochitest.ini index 5242bf9b1..30b90664a 100644 --- a/dom/tests/mochitest/localstorage/mochitest.ini +++ b/dom/tests/mochitest/localstorage/mochitest.ini @@ -47,6 +47,5 @@ skip-if = toolkit == 'android' #TIMED_OUT skip-if = toolkit == 'android' #TIMED_OUT [test_localStorageReplace.html] skip-if = toolkit == 'android' -[test_lowDeviceStorage.html] [test_storageConstructor.html] [test_localStorageSessionPrefOverride.html] diff --git a/dom/tests/mochitest/localstorage/test_lowDeviceStorage.html b/dom/tests/mochitest/localstorage/test_lowDeviceStorage.html deleted file mode 100644 index 046587150..000000000 --- a/dom/tests/mochitest/localstorage/test_lowDeviceStorage.html +++ /dev/null @@ -1,76 +0,0 @@ -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<title>Test localStorage usage while in a low device storage situation</title> - -<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> -<script type="text/javascript" src="localStorageCommon.js"></script> -<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> - -<script type="text/javascript"> - -/* -This test does the following: -- Stores an item in localStorage. -- Checks the stored value. -- Emulates a low device storage situation. -- Gets the stored item again. -- Removes the stored item. -- Fails storing a new value. -- Emulates recovering from a low device storage situation. -- Stores a new value. -- Checks the stored value. -*/ - -function lowDeviceStorage(lowStorage) { - var data = lowStorage ? "full" : "free"; - os().notifyObservers(null, "disk-space-watcher", data); -} - -function startTest() { - // Add a test item. - localStorage.setItem("item", "value"); - is(localStorage.getItem("item"), "value", "getItem()"); - - // Emulates a low device storage situation. - lowDeviceStorage(true); - - // Checks that we can still access to the stored item. - is(localStorage.getItem("item"), "value", - "getItem() during a device storage situation"); - - // Removes the stored item. - localStorage.removeItem("item"); - is(localStorage.getItem("item"), null, - "getItem() after removing the item"); - - // Fails storing a new item. - try { - localStorage.setItem("newItem", "value"); - ok(false, "Storing a new item is expected to fail"); - } catch(e) { - ok(true, "Got an expected exception " + e); - } finally { - is(localStorage.getItem("newItem"), null, - "setItem while device storage is low"); - } - - // Emulates recovering from a low device storage situation. - lowDeviceStorage(false); - - // Add a test item after recovering from the low device storage situation. - localStorage.setItem("newItem", "value"); - is(localStorage.getItem("newItem"), "value", - "getItem() with available storage"); - - SimpleTest.finish(); -} - -SimpleTest.waitForExplicitFinish(); - -</script> - -</head> - -<body onload="startTest();"> -</body> -</html> |