diff options
Diffstat (limited to 'tools/addon-sdk-1.7/packages/api-utils/tests/test-hidden-frame.js')
-rw-r--r-- | tools/addon-sdk-1.7/packages/api-utils/tests/test-hidden-frame.js | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/tools/addon-sdk-1.7/packages/api-utils/tests/test-hidden-frame.js b/tools/addon-sdk-1.7/packages/api-utils/tests/test-hidden-frame.js deleted file mode 100644 index 2441c3e..0000000 --- a/tools/addon-sdk-1.7/packages/api-utils/tests/test-hidden-frame.js +++ /dev/null @@ -1,51 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -let tests = {}, hiddenFrames, HiddenFrame; - -tests.testFrame = function(test) { - let url = "data:text/html,<!DOCTYPE%20html>"; - test.waitUntilDone(); - let hiddenFrame = hiddenFrames.add(HiddenFrame({ - onReady: function () { - test.assertEqual(this.element.contentWindow.location, "about:blank", - "HiddenFrame loads about:blank by default."); - - function onDOMReady() { - hiddenFrame.element.removeEventListener("DOMContentLoaded", onDOMReady, - false); - test.assertEqual(hiddenFrame.element.contentWindow.location, url, - "HiddenFrame loads the specified content."); - test.done(); - } - this.element.addEventListener("DOMContentLoaded", onDOMReady, false); - this.element.setAttribute("src", url); - } - })); -}; - -let hiddenFrameSupported = true; - -try { - hiddenFrames = require("hidden-frame"); - HiddenFrame = hiddenFrames.HiddenFrame; -} -catch(ex if ex.message == [ - "The hidden-frame module currently supports only Firefox and Thunderbird. ", - "In the future, we would like it to support other applications, however. ", - "Please see https://bugzilla.mozilla.org/show_bug.cgi?id=546740 for more ", - "information." - ].join("")) { - hiddenFrameSupported = false; -} - -if (hiddenFrameSupported) { - for (let test in tests) - exports[test] = tests[test]; -} -else { - exports.testHiddenFrameNotSupported = function(test) { - test.pass("The hidden-frame module is not supported on this app."); - } -} |