diff options
author | Matt A. Tobin <email@mattatobin.com> | 2020-02-25 15:07:00 -0500 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2020-02-25 15:07:00 -0500 |
commit | 0ddd00f1959c78ce37c14fef3c83401408fca3bf (patch) | |
tree | d408e02767c86cf8aac3acbb86722b03c77ede6f /toolkit/components/prompts/test/test_subresources_prompts.html | |
parent | 20f0905b33cbb18d1caa80c55e2f552c2e18957b (diff) | |
download | UXP-0ddd00f1959c78ce37c14fef3c83401408fca3bf.tar UXP-0ddd00f1959c78ce37c14fef3c83401408fca3bf.tar.gz UXP-0ddd00f1959c78ce37c14fef3c83401408fca3bf.tar.lz UXP-0ddd00f1959c78ce37c14fef3c83401408fca3bf.tar.xz UXP-0ddd00f1959c78ce37c14fef3c83401408fca3bf.zip |
Issue #439 - Remove tests from toolkit/
Diffstat (limited to 'toolkit/components/prompts/test/test_subresources_prompts.html')
-rw-r--r-- | toolkit/components/prompts/test/test_subresources_prompts.html | 202 |
1 files changed, 0 insertions, 202 deletions
diff --git a/toolkit/components/prompts/test/test_subresources_prompts.html b/toolkit/components/prompts/test/test_subresources_prompts.html deleted file mode 100644 index 241ce430f..000000000 --- a/toolkit/components/prompts/test/test_subresources_prompts.html +++ /dev/null @@ -1,202 +0,0 @@ -<html> -<head> - <title>Test subresources prompts (Bug 625187 and bug 1230462)</title> - <script type="text/javascript" src="/MochiKit/MochiKit.js"></script> - <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> - <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script> - <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script> - <script type="text/javascript" src="prompt_common.js"></script> - <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"> -<!-- - - Any copyright is dedicated to the Public Domain. - - http://creativecommons.org/publicdomain/zero/1.0/ - - - - Contributor(s): - - Mihai Sucan <mihai.sucan@gmail.com> - --> -</head> -<body> -<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=625187">Mozilla Bug 625187</a> -<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1230462">Mozilla Bug 1230462</a> - -<p><button onclick="alert('hello world')">Button</button></p> - -<iframe id="iframe_diff_origin" src="http://example.com/tests/toolkit/components/prompts/test/bug625187_iframe.html"></iframe> - -<iframe id="iframe_same_origin" src="bug625187_iframe.html"></iframe> - -<iframe id="iframe_prompt"></iframe> - -<pre id="test"></pre> - -<script class="testbody" type="text/javascript"> -var iframe1Loaded = onloadPromiseFor("iframe_diff_origin"); -var iframe2Loaded = onloadPromiseFor("iframe_same_origin"); -var iframe_prompt = document.getElementById("iframe_prompt"); - -add_task(function* runTest() -{ - // This test depends on tab modal prompts being enabled. - if (!isTabModal) { - todo(false, "Test disabled when tab modal prompts are not enabled."); - return; - } - - info("Ensuring iframe1 has loaded..."); - yield iframe1Loaded; - info("Ensuring iframe2 has loaded..."); - yield iframe2Loaded; - let state, action; - - state = { - msg : "hello world", - iconClass : "alert-icon", - titleHidden : true, - textHidden : true, - passHidden : true, - checkHidden : true, - textValue : "", - passValue : "", - checkMsg : "", - checked : false, - focused : "button0", - defButton : "button0", - }; - action = { - buttonClick: "ok", - }; - - promptDone = handlePrompt(state, action); - - var button = document.querySelector("button"); - dispatchMouseEvent(button, "click"); - - yield promptDone; - - - // mostly reusing same state/action - state.titleHidden = false; - state.msg = "hello world 2"; - promptDone = handlePrompt(state, action); - - var iframe = document.getElementById("iframe_diff_origin"); - button = SpecialPowers.wrap(iframe.contentWindow).document.getElementById("btn1"); - dispatchMouseEvent(button, "click"); - - yield promptDone; - - - // mostly reusing same state/action - state.titleHidden = true; - state.msg = "hello world 2"; - promptDone = handlePrompt(state, action); - - iframe = document.getElementById("iframe_same_origin"); - button = iframe.contentWindow.document.getElementById("btn1"); - dispatchMouseEvent(button, "click"); - - yield promptDone; - - - // mostly reusing same state/action - state.msg = "hello world 3"; - promptDone = handlePrompt(state, action); - - button = iframe.contentWindow.document.getElementById("btn2"); - dispatchMouseEvent(button, "click"); - - yield promptDone; -}); - -add_task(function* runTestAuth() -{ - // Following tests chack prompt message for a cross-origin and not - // cross-origin subresources load - - // Force parent to not look for tab-modal prompts, as they're not - // used for auth prompts. - isTabModal = false; - - state = { - msg : "http://mochi.test:8888 is requesting your username " + - "and password. The site says: “mochitest”", - title : "Authentication Required", - textValue : "", - passValue : "", - iconClass : "authentication-icon question-icon", - titleHidden : true, - textHidden : false, - passHidden : false, - checkHidden : true, - checkMsg : "", - checked : false, - focused : "textField", - defButton : "button0", - }; - - action = { - buttonClick : "ok", - setCheckbox : false, - textField : "mochiuser1", - passField : "mochipass1", - }; - - promptDone = handlePrompt(state, action); - - var iframe3Loaded = onloadPromiseFor("iframe_prompt"); - iframe_prompt.src = "authenticate.sjs?user=mochiuser1&pass=mochipass1"; - yield promptDone; - yield iframe3Loaded; - checkEchoedAuthInfo({user: "mochiuser1", pass: "mochipass1"}, - iframe_prompt.contentDocument); - - // Cross-origin subresourse test. - - // Force parent to not look for tab-modal prompts, as they're not used for auth prompts. - isTabModal =false; - state = { - msg : "http://example.com is requesting your username and password. " + - "WARNING: Your password will not be sent to the website you are currently visiting!", - title : "Authentication Required", - textValue : "", - passValue : "", - iconClass : "authentication-icon question-icon", - titleHidden : true, - textHidden : false, - passHidden : false, - checkHidden : true, - checkMsg : "", - checked : false, - focused : "textField", - defButton : "button0", - }; - - action = { - buttonClick : "ok", - setCheckbox : false, - textField : "mochiuser2", - passField : "mochipass2", - }; - - promptDone = handlePrompt(state, action); - - iframe3Loaded = onloadPromiseFor("iframe_prompt"); - iframe_prompt.src = "http://example.com/tests/toolkit/components/prompts/test/authenticate.sjs?user=mochiuser2&pass=mochipass2&realm=mochitest"; - yield promptDone; - yield iframe3Loaded; - checkEchoedAuthInfo({user: "mochiuser2", pass: "mochipass2"}, - SpecialPowers.wrap(iframe_prompt.contentWindow).document); -}); - -function dispatchMouseEvent(target, type) -{ - var win = SpecialPowers.unwrap(target.ownerDocument.defaultView); - var e = document.createEvent("MouseEvent"); - e.initEvent(type, false, false, win, 0, 1, 1, 1, 1, - false, false, false, false, 0, null); - var utils = SpecialPowers.getDOMWindowUtils(win); - utils.dispatchDOMEventViaPresShell(SpecialPowers.unwrap(target), e, true); -} -</script> -</body> -</html> |