Commit 7de33b3e authored by Tim Huang's avatar Tim Huang Committed by Georg Koppen
Browse files

Bug 680300 - Part 2: Add a test case for ensuring no error reporting when...

Bug 680300 - Part 2: Add a test case for ensuring no error reporting when loading an unknown protocol. r=smaug

This test case will try to navigate an iframe to an unknown protocol and
check whether no errors been reported.

Differential Revision: https://phabricator.services.mozilla.com/D3493

--HG--
extra : moz-landing-system : lando
parent d3450d02
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -8,5 +8,6 @@ support-files =
[test_handlerApps.xhtml]
skip-if = (toolkit == 'android' || os == 'mac') || e10s # OS X: bug 786938
scheme = https
[test_unknown_ext_protocol_handlers.html]
[test_unsafeBidiChars.xhtml]
[test_web_protocol_handlers.html]
+28 −0
Original line number Diff line number Diff line
<!DOCTYPE html>
<html>
<head>
  <title>Test for no error reporting for unknown external protocols</title>
  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<iframe id="testFrame"></iframe>
<script type="text/javascript">

SimpleTest.waitForExplicitFinish();

window.onload = () => {
  let testFrame = document.getElementById("testFrame");

  try {
    testFrame.contentWindow.location.href = "unknownextproto:";
    ok(true, "There is no error reporting for unknown external protocol navigation.");
  } catch (e) {
    ok(false, "There should be no error reporting for unknown external protocol navigation.");
  }

  SimpleTest.finish();
}
</script>
</body>
</html>