diff options
Diffstat (limited to 'testing/marionette/harness/marionette_harness/www')
63 files changed, 1781 insertions, 0 deletions
diff --git a/testing/marionette/harness/marionette_harness/www/addons/webextension-signed.xpi b/testing/marionette/harness/marionette_harness/www/addons/webextension-signed.xpi Binary files differnew file mode 100644 index 0000000000..5363911af1 --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/addons/webextension-signed.xpi diff --git a/testing/marionette/harness/marionette_harness/www/addons/webextension-unsigned.xpi b/testing/marionette/harness/marionette_harness/www/addons/webextension-unsigned.xpi Binary files differnew file mode 100644 index 0000000000..cf0fad63b5 --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/addons/webextension-unsigned.xpi diff --git a/testing/marionette/harness/marionette_harness/www/black.png b/testing/marionette/harness/marionette_harness/www/black.png Binary files differnew file mode 100644 index 0000000000..b62a3a7bc8 --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/black.png diff --git a/testing/marionette/harness/marionette_harness/www/bug814037.html b/testing/marionette/harness/marionette_harness/www/bug814037.html new file mode 100644 index 0000000000..47c2968163 --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/bug814037.html @@ -0,0 +1,56 @@ +<html> +<head> +<meta name="viewport" content="minimum-scale=1,width=device-width"> +<style> +body { + width: 100%; + margin: 0px; + transition: transform 300ms ease; + overflow-x: hidden; +} + +body.section1 { + transform: translateX(0%); +} + +body.section2 { + transform: translateX(-100%); +} + +section { + width: 100%; + height: 100%; + position: absolute; +} + +#section1 { + left: 0px; +} + +#section2 { + left: 100%; +} +.mypossie { + position:absolute; + left: -1000px; +} +</style> + +</head> + <body class="section1"> + <section id="section1"> + <div id="assertMe1"> + <p>Section 1</p> + </div> + <button id="b1" onclick="var sect = document.getElementsByTagName('body')[0]; sect.classList.add('section2'); sect.classList.remove('section1');">Show section 2</button> + </section> + + <section id="section2"> + <div id="assertMe2"> + <p>Section 2</p> + </div> + <button id="b2" onclick="var sect = document.getElementsByTagName('body')[0]; sect.classList.add('section1'); sect.classList.remove('section2'); ">Show section 1</button> + </section> + <section class='mypossie'>out in left field!</section> + </body> +</html> diff --git a/testing/marionette/harness/marionette_harness/www/click_out_of_bounds_overflow.html b/testing/marionette/harness/marionette_harness/www/click_out_of_bounds_overflow.html new file mode 100644 index 0000000000..f0bee9b469 --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/click_out_of_bounds_overflow.html @@ -0,0 +1,90 @@ +<!-- 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/. --> + +<!DOCTYPE html> +<html><head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> +<body> +<div style="height: 100px; overflow: auto;"> + <table> + <tbody> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td>data</td></tr> + <tr><td><a href="#clicked" id="link">click me</a></td></tr> + </tbody> + </table> +</div> +</body> +</html> diff --git a/testing/marionette/harness/marionette_harness/www/clicks.html b/testing/marionette/harness/marionette_harness/www/clicks.html new file mode 100644 index 0000000000..96e9f55171 --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/clicks.html @@ -0,0 +1,57 @@ +<html> +<head> + <!-- 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/. --> + <title>Testing Clicks</title> + + <script> + function addMousedownListener() { + let el = document.getElementById('showbutton'); + + el.addEventListener('mousedown', function (evt) { + evt.target.innerText = evt.button; + }); + } + </script> +</head> + +<body> +<h1>Testing Clicks</h1> + +<div> + <p id="links">Links:</p> + <ul> + <li><a href="test.html">333333</a> + <li><a href="test.html" id="normal">Normal</a> + <li><a href="#" id="anchor">I go to an anchor</a> + <li><a href="addons/webextension-unsigned.xpi" id="install-addon">Install Add-on</a> + </ul> +</div> + +<div> + <p id="js-links">Javascript links:</p> + <ul> + <li>Navigate in history: + <a href="javascript:history.back();" id="history-back">Back</a> + <a href="javascript:history.forward();" id="history-forward">Forward</a> + <li><a href="javascript:window.open('test.html', '_blank')" id="new-window">Open a window</a> + <li><a href="javascript:window.close();" id="close-window">Close tab/window</a> + <li><a id="addbuttonlistener" href="javascript:addMousedownListener();">Click</a> to + add an event listener for: <span style="color: red;" id="showbutton">button click</span> + </ul> +</div> + +<div> + <p id="special">Special:</p> + <select id="option" onclick="window.location = '/slow?delay=1'"> + <option>Click to navigate</option> + </select> + + <p style="background-color: rgb(0, 255, 0); width: 5em;"> + <a id="overflowLink" href="test.html">looooooooooong short looooooooooong</a> + </p> +</div> + +</body> +</html> diff --git a/testing/marionette/harness/marionette_harness/www/dom/cacheUsage.html b/testing/marionette/harness/marionette_harness/www/dom/cacheUsage.html new file mode 100644 index 0000000000..8bb7da8f71 --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/dom/cacheUsage.html @@ -0,0 +1,28 @@ +<html> + <head> + <script> + async function getStorageEstimate() { + let r = await navigator.storage.estimate(); + return r.usage; + } + + function openCache(id) { + return caches.open(id); + } + + async function doCacheWork(id, n) { + let c = await openCache(id); + + const body = new Uint32Array(1024); + self.crypto.getRandomValues(body); + + for (let i = 0; i < n; i++) { + await c.put(new Request(`/data-${i}`), new Response(body)) + } + + await caches.delete(id) + return "success"; + } + </script> + </head> +</html> diff --git a/testing/marionette/harness/marionette_harness/www/dom/indexedDB/basicIDB_PBM.html b/testing/marionette/harness/marionette_harness/www/dom/indexedDB/basicIDB_PBM.html new file mode 100644 index 0000000000..27760be6db --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/dom/indexedDB/basicIDB_PBM.html @@ -0,0 +1,40 @@ +<html> + <head> + <script> + async function ensureIDB(name, ver, store) { + return new Promise((resolve, reject) => { + let createObjectStore = (db, store) => { + db.createObjectStore(store); + }; + + var req = indexedDB.open(name, ver); + req.onerror = reject; + + req.onsuccess = (event) => { + resolve(req.result); + }; + + req.onupgradeneeded = function (event) { + let db = event.target.result; + createObjectStore(db, store); + }; + }); + }; + + async function addDataIntoIDB(idb, store, key, value) { + let db = await ensureIDB(idb, 1, store); + await (new Promise((resolve, reject) => { + var transaction = db.transaction([store], "readwrite"); + var put = transaction.objectStore(store).put(value, key); + put.onsuccess = resolve(); + })); + + closeIDB(db) + }; + + function closeIDB(db) { + db.close(); + } + </script> + </head> +</html> diff --git a/testing/marionette/harness/marionette_harness/www/element_outside_viewport.html b/testing/marionette/harness/marionette_harness/www/element_outside_viewport.html new file mode 100644 index 0000000000..69b66b8759 --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/element_outside_viewport.html @@ -0,0 +1,41 @@ +<!DOCTYPE html> +<style> + div { + position: absolute; + width: 100px; + height: 100px; + } + .top { background-color: red; } + #top-70 { left: 80px; top: 0; } + #top-50 { left: 190px; top: 20px; } + #top-30 { left: 300px; top: 40px; } + + .right { background-color: black; } + #right-70 { top: 80px; right: -140px;} + #right-50 { top: 190px; right: -120px;} + #right-30 { top: 300px; right: -100px;} + + .bottom { background-color: blue; } + #bottom-70 { right: -50px; bottom: -140px; } + #bottom-50 { right: 60px; bottom: -120px; } + #bottom-30 { right: 170px; bottom: -100px; } + + .left { background-color: green; } + #left-70 { bottom: -50px; left: 0; } + #left-50 { bottom: 60px; left: 20px; } + #left-30 { bottom: 170px; left: 40px; } +</style> +<body onload="window.scrollTo(70, 70);"> + <div id="top-70" class="top"></div> + <div id="top-50" class="top"></div> + <div id="top-30" class="top"></div> + <div id="right-70" class="right"></div> + <div id="right-50" class="right"></div> + <div id="right-30" class="right"></div> + <div id="bottom-70" class="bottom"></div> + <div id="bottom-50" class="bottom"></div> + <div id="bottom-30" class="bottom"></div> + <div id="left-70" class="left"></div> + <div id="left-50" class="left"></div> + <div id="left-30" class="left"></div> +</body> diff --git a/testing/marionette/harness/marionette_harness/www/empty.html b/testing/marionette/harness/marionette_harness/www/empty.html new file mode 100644 index 0000000000..646edf9a72 --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/empty.html @@ -0,0 +1,12 @@ +<!-- 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/. --> + +<!DOCTYPE html> +<html> +<head> +<title>Marionette Test</title> +</head> +<body> +</body> +</html> diff --git a/testing/marionette/harness/marionette_harness/www/formPage.html b/testing/marionette/harness/marionette_harness/www/formPage.html new file mode 100644 index 0000000000..43fde32431 --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/formPage.html @@ -0,0 +1,114 @@ +<html> +<head> + <title>We Leave From Here</title> + + <script type="text/javascript"> + function changePage() { + let newLocation = '/common/page/3'; + window.location = newLocation; + } + </script> +</head> +<body> +There should be a form here: + +<form method="get" action="resultPage.html" name="login"> + <input type="email" id="email"/> + <input type="submit" id="submitButton" value="Hello there"/> +</form> + +<form method="get" action="resultPage.html" name="optional" style="display: block"> + Here's a checkbox: + <input type="checkbox" id="checky" name="checky" value="furrfu"/> + <input type="checkbox" id="checkedchecky" name="checkedchecky" checked="checked" /> + <input type="checkbox" id="disabledchecky" disabled="disabled" name="disabledchecky" /> + <input type="checkbox" id="randomly_disabled_checky" disabled="somerandomstring" checked="checked" name="randomlydisabledchecky" /> + <br/> + <select name="selectomatic"> + <option selected="selected" id="non_multi_option" value="one">One</option> + <option value="two">Two</option> + <option value="four">Four</option> + <option value="still learning how to count, apparently">Still learning how to count, apparently</option> + </select> + + <select name="multi" id="multi" multiple="multiple"> + <option selected="selected" value="eggs">Eggs</option> + <option value="ham">Ham</option> + <option selected="selected" value="sausages">Sausages</option> + <option value="onion gravy">Onion gravy</option> + </select> + + <select name="no-select" disabled="disabled"> + <option value="foo">Foo</option> + </select> + + <select name="select_empty_multiple" multiple> + <option id="multi_1" value="select_1">select_1</option> + <option id="multi_2" value="select_2">select_2</option> + <option id="multi_3" value="select_3">select_3</option> + <option id="multi_4" value="select_4">select_4</option> + </select> + + <select name="multi_true" multiple="true"> + <option id="multi_true_1" value="select_1">select_1</option> + <option id="multi_true_2" value="select_2">select_2</option> + </select> + + <select name="multi_false" multiple="false"> + <option id="multi_false_1" value="select_1">select_1</option> + <option id="multi_false_2" value="select_2">select_2</option> + </select> + + <select id="invisi_select" style="opacity:0;"> + <option selected value="apples">Apples</option> + <option value="oranges">Oranges</option> + </select> + + <select name="select-default"> + <option>One</option> + <option>Two</option> + <option>Four</option> + <option>Still learning how to count, apparently</option> + </select> + + <select name="select_with_spaces"> + <option>One</option> + <option> Two </option> + <option> + Four + </option> + <option> + Still learning how to count, + apparently + </option> + </select> + + <select> + <option id="blankOption"></option> + <option id="optionEmptyValueSet" value="">nothing</option> + </select> + + <br/> + + <input type="radio" id="cheese" name="snack" value="cheese"/>Cheese<br/> + <input type="radio" id="peas" name="snack" value="peas"/>Peas<br/> + <input type="radio" id="cheese_and_peas" name="snack" value="cheese and peas" checked/>Cheese and peas<br/> + <input type="radio" id="nothing" name="snack" value="nowt" disabled="disabled"/>Not a sausage<br/> + <input type="radio" id="randomly_disabled_nothing" name="snack" value="funny nowt" disabled="somedisablingstring"/>Not another sausage + + <input type="hidden" name="hidden" value="fromage" /> + + <p id="cheeseLiker">I like cheese</p> + <input type="submit" value="Click!"/> + + <input type="radio" id="lone_disabled_selected_radio" name="not_a_snack" value="cumberland" checked="checked" disabled="disabled" />Cumberland sausage +</form> + +<form method="get" action="formPage.html"> + <p> + <label for="checkbox-with-label" id="label-for-checkbox-with-label">Label</label><input type="checkbox" id="checkbox-with-label" /> + </p> +</form> +<input id="vsearchGadget" name="SearchableText" type="text" size="18" value="" title="Hvad søger du?" accesskey="4" class="inputLabel" /> +</body> +</html> diff --git a/testing/marionette/harness/marionette_harness/www/frameset.html b/testing/marionette/harness/marionette_harness/www/frameset.html new file mode 100644 index 0000000000..e91472c952 --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/frameset.html @@ -0,0 +1,13 @@ +<html> + <head> + <title>Unique title</title> + </head> +<frameset cols="*, *, *, *, *, *, *"> + <frame name="first" src="page/1"/> + <frame name="second" src="page/2?title=Fish"/> + <frame name="third" src="formPage.html"/> + <frame name="fourth" src="framesetPage2.html"/> + <frame id="fifth" src="xhtmlTest.html"/> + <frame id="sixth" src="test_iframe.html"/> + <frame id="sixth.iframe1" src="page/3"/> +</frameset> diff --git a/testing/marionette/harness/marionette_harness/www/framesetPage2.html b/testing/marionette/harness/marionette_harness/www/framesetPage2.html new file mode 100644 index 0000000000..5190ceb6ce --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/framesetPage2.html @@ -0,0 +1,7 @@ +<html> +<head></head> +<frameset cols="*, *"> + <frame name="child1" src="test.html"/> + <frame name="child2" src="test.html"/> +</frameset> +</html> diff --git a/testing/marionette/harness/marionette_harness/www/html5/blue.jpg b/testing/marionette/harness/marionette_harness/www/html5/blue.jpg Binary files differnew file mode 100644 index 0000000000..8ea27c42fa --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/html5/blue.jpg diff --git a/testing/marionette/harness/marionette_harness/www/html5/boolean_attributes.html b/testing/marionette/harness/marionette_harness/www/html5/boolean_attributes.html new file mode 100644 index 0000000000..431e575aef --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/html5/boolean_attributes.html @@ -0,0 +1,2 @@ +<!DOCTYPE html> +<input id='disabled' disabled> diff --git a/testing/marionette/harness/marionette_harness/www/html5/geolocation.js b/testing/marionette/harness/marionette_harness/www/html5/geolocation.js new file mode 100644 index 0000000000..4fb4a4747b --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/html5/geolocation.js @@ -0,0 +1,29 @@ +/* eslint-disable no-unsanitized/property */ + +function success(position) { + let message = document.getElementById("status"); + message.innerHTML = + "<img src='http://maps.google.com/maps/api/staticmap?center=" + + position.coords.latitude + + "," + + position.coords.longitude + + "&size=300x200&maptype=roadmap&zoom=12&&markers=size:mid|color:red|" + + position.coords.latitude + + "," + + position.coords.longitude + + "&sensor=false' />"; + message.innerHTML += "<p>Longitude: " + position.coords.longitude + "</p>"; + message.innerHTML += "<p>Latitude: " + position.coords.latitude + "</p>"; + message.innerHTML += "<p>Altitude: " + position.coords.altitude + "</p>"; +} + +function error(msg) { + let message = document.getElementById("status"); + message.innerHTML = "Failed to get geolocation."; +} + +if (navigator.geolocation) { + navigator.geolocation.getCurrentPosition(success, error); +} else { + error("Geolocation is not supported."); +} diff --git a/testing/marionette/harness/marionette_harness/www/html5/green.jpg b/testing/marionette/harness/marionette_harness/www/html5/green.jpg Binary files differnew file mode 100644 index 0000000000..6a0d3bea47 --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/html5/green.jpg diff --git a/testing/marionette/harness/marionette_harness/www/html5/offline.html b/testing/marionette/harness/marionette_harness/www/html5/offline.html new file mode 100644 index 0000000000..c24178b5f5 --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/html5/offline.html @@ -0,0 +1 @@ +<html><head><title>Offline</title></head><body></body></html> diff --git a/testing/marionette/harness/marionette_harness/www/html5/red.jpg b/testing/marionette/harness/marionette_harness/www/html5/red.jpg Binary files differnew file mode 100644 index 0000000000..f296e27195 --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/html5/red.jpg diff --git a/testing/marionette/harness/marionette_harness/www/html5/status.html b/testing/marionette/harness/marionette_harness/www/html5/status.html new file mode 100644 index 0000000000..394116a522 --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/html5/status.html @@ -0,0 +1 @@ +<html><head><title>Online</title></head><body></body></html> diff --git a/testing/marionette/harness/marionette_harness/www/html5/test.appcache b/testing/marionette/harness/marionette_harness/www/html5/test.appcache new file mode 100644 index 0000000000..3bc4e00257 --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/html5/test.appcache @@ -0,0 +1,11 @@ +CACHE MANIFEST + +CACHE: +# Additional items to cache. +yellow.jpg +red.jpg +blue.jpg +green.jpg + +FALLBACK: +status.html offline.html diff --git a/testing/marionette/harness/marionette_harness/www/html5/test_html_inputs.html b/testing/marionette/harness/marionette_harness/www/html5/test_html_inputs.html new file mode 100644 index 0000000000..a170ced1ab --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/html5/test_html_inputs.html @@ -0,0 +1,2 @@ +<!DOCTYPE html> +<input id='number' type=number> diff --git a/testing/marionette/harness/marionette_harness/www/html5/yellow.jpg b/testing/marionette/harness/marionette_harness/www/html5/yellow.jpg Binary files differnew file mode 100644 index 0000000000..7c609b3712 --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/html5/yellow.jpg diff --git a/testing/marionette/harness/marionette_harness/www/html5Page.html b/testing/marionette/harness/marionette_harness/www/html5Page.html new file mode 100644 index 0000000000..fbd943d792 --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/html5Page.html @@ -0,0 +1,46 @@ +<html manifest="html5/test.appcache"> +<!-- +Copyright 2011 Software Freedom Conservancy. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +--> + + +<head> +<title>HTML5</title> +</head> +<body> + +<h3>Geolocation Test</h3> +<div id="status">Location unknown</div> +<script language="javascript" type="text/javascript" src="html5/geolocation.js"></script> + +<h3>Application Cache Test</h3> +<div id="images"> + <p>Current network status: <span id="state"></span></p> + <script> + const state = document.getElementById('state') + setInterval(function () { + state.className = navigator.onLine ? 'online' : 'offline'; + // eslint-disable-next-line no-unsanitized/property + state.innerHTML = navigator.onLine ? 'online' : 'offline'; + }, 250); + </script> + <img id="red" src="html5/red.jpg"> + <img id="blue" src="html5/blue.jpg"> + <img id="green" src="html5/green.jpg"> + <img id="yellow" src="html5/yellow.jpg"> +</div> + +</body> +</html> diff --git a/testing/marionette/harness/marionette_harness/www/keyboard.html b/testing/marionette/harness/marionette_harness/www/keyboard.html new file mode 100644 index 0000000000..e711b31e05 --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/keyboard.html @@ -0,0 +1,99 @@ +<?xml version="1.0"?> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> + <!-- 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/. --> + +<head> + <title>Testing Javascript</title> + <meta name="viewport" content="user-scalable=no"> + <script type="text/javascript"> + const seen = {}; + + function updateResult(event) { + document.getElementById('result').innerText = event.target.value; + } + + function displayMessage(message) { + document.getElementById('result').innerText = message; + } + + function appendMessage(message) { + document.getElementById('result').innerText += " " + message + " "; + } + </script> +</head> + +<body> +<h1>Type Stuff</h1> + +<div id="resultContainer"> + Result: <p id="result"></p> +</div> + +<div> + <form action="#"> + <p> + <label>keyDown: <input type="text" id="keyDown" onkeydown="updateResult(event)"/></label> + <label>keyPress: <input type="text" id="keyPress" onkeypress="updateResult(event)"/></label> + <label>keyUp: <input type="text" id="keyUp" onkeyup="updateResult(event)"/></label> + <label>change: <input type="text" id="change" onchange="updateResult(event)"/></label> + </p> + <p> + <label>change: + <input type="checkbox" id="checkbox" value="checkbox thing" onchange="updateResult(event)"/> + </label> + </p> + <p> + <label>keyDown: + <textarea id="keyDownArea" onkeydown="updateResult(event)" rows="2" cols="15"></textarea> + </label> + <label>keyPress: + <textarea id="keyPressArea" onkeypress="updateResult(event)" rows="2" cols="15"></textarea> + </label> + <label>keyUp: + <textarea id="keyUpArea" onkeyup="updateResult(event)" rows="2" cols="15"></textarea> + </label> + </p> + <p> + <select id="selector" onchange="updateResult(event)"> + <option value="foo">Foo</option> + <option value="bar">Bar</option> + </select> + </p> + </form> +</div> + +<div id="formageddon"> + <form action="#"> + Key Up: <input type="text" id="keyUp" onkeyup="javascript:updateContent(this)"/><br/> + Key Down: <input type="text" id="keyDown" onkeydown="javascript:updateContent(this)"/><br/> + Key Press: <input type="text" id="keyPress" onkeypress="javascript:updateContent(this)"/><br/> + Change: <input type="text" id="change" onkeypress="javascript:displayMessage('change')"/><br/> + <textarea id="keyDownArea" onkeydown="javascript:updateContent(this)" rows="2" cols="15"></textarea> + <textarea id="keyPressArea" onkeypress="javascript:updateContent(this)" rows="2" cols="15"></textarea> + <textarea id="keyUpArea" onkeyup="javascript:updateContent(this)" rows="2" cols="15"></textarea> + <select id="selector" onchange="javascript:updateContent(this)"> + <option value="foo">Foo</option> + <option value="bar">Bar</option> + </select> + <input type="checkbox" id="checkbox" value="checkbox thing" onchange="javascript:updateContent(this)"/> + <input id="clickField" type="text" onclick="document.getElementById('clickField').value='Clicked';" value="Hello"/> + <input id="doubleClickField" type="text" onclick="document.getElementById('doubleClickField').value='Clicked';" ondblclick="document.getElementById('doubleClickField').value='DoubleClicked';" oncontextmenu="document.getElementById('doubleClickField').value='ContextClicked'; return false;" value="DoubleHello"/> + <input id="clearMe" value="Something" onchange="displayMessage('Cleared')"/> + <input type="text" id="notDisplayed" style="display: none"> + </form> +</div> + +<div> + <form> + <input type="text" id="keyReporter" size="80" + onkeyup="appendMessage('up: ' + event.keyCode)" + onkeypress="appendMessage('press: ' + event.keyCode)" + onkeydown="displayMessage(''); appendMessage('down: ' + event.keyCode)" /> + <input name="suppress" onkeydown="if (event.preventDefault) event.preventDefault(); event.returnValue = false; return false;" onkeypress="appendMessage('press');"/> + </form> +</div> + +</body> +</html> diff --git a/testing/marionette/harness/marionette_harness/www/layout/test_carets_columns.html b/testing/marionette/harness/marionette_harness/www/layout/test_carets_columns.html new file mode 100644 index 0000000000..bc414cfc45 --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/layout/test_carets_columns.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- Any copyright is dedicated to the Public Domain. + - http://creativecommons.org/publicdomain/zero/1.0/ --> + +<html> + <head> + <meta charset="UTF-8"> + <style> + #columns { + column-count: 2; + -webkit-column-count: 2; + column-rule: 1px solid lightgray; + -webkit-column-rule: 1px solid lightgray; + border: 1px solid lightblue; + width: 450px; + } + </style> + </head> + <body> + <div id="columns"> + <div id="columns-inner" style="border: 1px solid red;" contenteditable="true"> + <p id="before-image-1">Before image 1</p> + <p><img width="100px" height="30px" src="data:image/gif;base64,R0lGODlhAQABAIABAAD/AP///ywAAAAAAQABAAACAkQBADs="></p> + <p>After image 1</p> + <p>Before image 2</p> + <p><img width="100px" height="30px" src="data:image/gif;base64,R0lGODlhAQABAIABAAD/AP///ywAAAAAAQABAAACAkQBADs="></p> + <p>After image 2</p> + </div> + </div> + </body> +</html> diff --git a/testing/marionette/harness/marionette_harness/www/layout/test_carets_cursor.html b/testing/marionette/harness/marionette_harness/www/layout/test_carets_cursor.html new file mode 100644 index 0000000000..fdbd6fe7a8 --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/layout/test_carets_cursor.html @@ -0,0 +1,31 @@ +<!-- 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/. --> + +<!DOCTYPE html> +<html id="html"> + <head> + <title>Marionette tests for AccessibleCaret in cursor mode</title> + <style> + .block { + width: 10em; + height: 6em; + word-wrap: break-word; + overflow: auto; + } + </style> + </head> + <body> + <div> + <input id="input" value="ABCDEFGHI"> + <input id="input-padding" style="padding: 1em;" value="ABCDEFGHI"> + </div> + <br> + <div> + <textarea name="textarea" id="textarea" rows="4" cols="6">ABCDEFGHI</textarea> + <textarea id="textarea-one-line" rows="3">ABCDEFGHI</textarea> + </div> + <br> + <div class="block" contenteditable="true" id="contenteditable">ABCDEFGHI</div> + </body> +</html> diff --git a/testing/marionette/harness/marionette_harness/www/layout/test_carets_display_none.html b/testing/marionette/harness/marionette_harness/www/layout/test_carets_display_none.html new file mode 100644 index 0000000000..766f320011 --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/layout/test_carets_display_none.html @@ -0,0 +1,10 @@ +<!-- 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/. --> + +<!DOCTYPE html> +<html id="html" style="display: none"> + <body> + <div id="content">ABC DEF GHI</div> + </body> +</html> diff --git a/testing/marionette/harness/marionette_harness/www/layout/test_carets_iframe.html b/testing/marionette/harness/marionette_harness/www/layout/test_carets_iframe.html new file mode 100644 index 0000000000..175d3c3d5c --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/layout/test_carets_iframe.html @@ -0,0 +1,15 @@ +<!-- 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/. --> + +<!DOCTYPE html> +<html id="html"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <title>Marionette tests for AccessibleCaret in selection mode (iframe)</title> + </head> + <body> + <iframe id="frame" src="test_carets_longtext.html" style="width: 10em; height: 8em;"></iframe> + <input id="input" value="ABC DEF GHI"> + </body> +</html> diff --git a/testing/marionette/harness/marionette_harness/www/layout/test_carets_iframe_scroll.html b/testing/marionette/harness/marionette_harness/www/layout/test_carets_iframe_scroll.html new file mode 100644 index 0000000000..5f4b00e5bd --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/layout/test_carets_iframe_scroll.html @@ -0,0 +1,11 @@ +<!DOCTYPE html> +<html> + <title>Bug 1657256: Test select word, scroll up, and drag AccessibleCaret.</title> + <style> + :root { + font: 16px/1.25 monospace; + } + </style> + + <iframe id="iframe" src="test_carets_iframe_scroll_inner.html" style="width: 6em; height: 8em;"></iframe> +</html> diff --git a/testing/marionette/harness/marionette_harness/www/layout/test_carets_iframe_scroll_inner.html b/testing/marionette/harness/marionette_harness/www/layout/test_carets_iframe_scroll_inner.html new file mode 100644 index 0000000000..1087227007 --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/layout/test_carets_iframe_scroll_inner.html @@ -0,0 +1,24 @@ +<!DOCTYPE html> +<html> + <style> + :root { + font: 16px/1.25 monospace; + } + </style> + + <body id="bd"> + AAAAAA + BBBBBB + CCCCCC + <span id="content">DDDDDD</span> + <span id="content2">EEEEEE</span> + FFFFFF + GGGGGG + HHHHHH + IIIIII + JJJJJJ + KKKKKK + LLLLLL + MMMMMM + </body> +</html> diff --git a/testing/marionette/harness/marionette_harness/www/layout/test_carets_longtext.html b/testing/marionette/harness/marionette_harness/www/layout/test_carets_longtext.html new file mode 100644 index 0000000000..7e2495509b --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/layout/test_carets_longtext.html @@ -0,0 +1,9 @@ +<html> + <head> + <title>Bug 1094072: Orientation change test for AccessibleCaret positions</title> + </head> + <body id="bd"> + <h3 id="longtext">long long text for orientation change test long long text for orientation change test long long text for orientation change test long long text for orientation change test</h3> + <div contenteditable="true" id="bottomtext">bottom text</div> +</body> +</html> diff --git a/testing/marionette/harness/marionette_harness/www/layout/test_carets_multipleline.html b/testing/marionette/harness/marionette_harness/www/layout/test_carets_multipleline.html new file mode 100644 index 0000000000..fbbefbebcb --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/layout/test_carets_multipleline.html @@ -0,0 +1,18 @@ +<!-- 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/. --> + +<!DOCTYPE html> +<html id="html"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <title>Bug 1019441: Marionette tests for AccessibleCaret (multiple lines)</title> + </head> + <body> + <div><textarea id="textarea2" style="width: 10em; height: 6em; overflow: auto;">First Line Second Line Third Line</textarea></div> + <br> + <div style="width: 10em; height: 6em; overflow: auto;" id="contenteditable2" contenteditable="true">First Line<br><br>Second Line<br><br>Third Line</div> + <br> + <div style="width: 10em; height: 6em; overflow: auto;" id="content2">First Line<br><br>Second Line<br><br>Third Line</div> + </body> +</html> diff --git a/testing/marionette/harness/marionette_harness/www/layout/test_carets_multiplerange.html b/testing/marionette/harness/marionette_harness/www/layout/test_carets_multiplerange.html new file mode 100644 index 0000000000..9b9bbe9e9f --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/layout/test_carets_multiplerange.html @@ -0,0 +1,19 @@ +<html> +<style> +h4 { + user-select: none; +} +</style> +<body id=bd> +<h3 id=sel1>user can select this 1</h3> +<h3 id=sel2>user can select this 2</h3> +<h3 id=sel3>user can select this 3</h3> +<h4 id=nonsel1>user cannot select this 1</h4> +<h4 id=nonsel2>user cannot select this 2</h4> +<h3 id=sel4>user can select this 4</h3> +<h3 id=sel5>user can select this 5</h3> +<h4 id=nonsel3>user cannot select this 3</h4> +<h3 id=sel6>user can select this 6</h3> +<h3 id=sel7>user can select this 7</h3> +</body> +</html> diff --git a/testing/marionette/harness/marionette_harness/www/layout/test_carets_selection.html b/testing/marionette/harness/marionette_harness/www/layout/test_carets_selection.html new file mode 100644 index 0000000000..f992ee1ba3 --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/layout/test_carets_selection.html @@ -0,0 +1,43 @@ +<!-- 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/. --> + +<!DOCTYPE html> +<html id="html"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <title>Marionette tests for AccessibleCaret in selection mode</title> + <style> + .block { + width: 10em; + height: 4em; + word-wrap: break-word; + overflow: auto; + } + </style> + </head> + <body> + <div> + <input id="input" value="ABC DEF GHI"> + <input id="input-padding" style="padding: 1em;" value="ABC DEF GHI"> + + <!-- To successfully select 'B's when 'A' is selected, use sufficient + spaces between 'A's and 'B's to avoid the second caret covers 'B's. --> + <input size="16" id="input-size" value="AAAAAAAA BBBBBBBB"> + </div> + <br> + <div> + <textarea id="textarea" rows="4" cols="8">ABC DEF GHI JKL MNO PQR</textarea> + <textarea id="textarea-disabled" rows="4" cols="8" disabled>ABC DEF GHI JKL MNO PQR</textarea> + <textarea id="textarea-one-line" rows="4" cols="12">ABC DEF GHI</textarea> + </div> + <br> + <div><textarea dir="rtl" id="textarea-rtl" rows="8" cols="8">موزيلا فيرفكس موزيلا فيرفكس</textarea></div> + <br> + <div class="block" contenteditable="true" id="contenteditable">ABC DEF GHI</div> + <br> + <div class="block" id="content">ABC DEF GHI</div> + <br> + <div style="user-select: none;" id="non-selectable">Non-selectable</div> + </body> +</html> diff --git a/testing/marionette/harness/marionette_harness/www/layout/test_carets_svg_shapes.html b/testing/marionette/harness/marionette_harness/www/layout/test_carets_svg_shapes.html new file mode 100644 index 0000000000..ea3ad4ecf6 --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/layout/test_carets_svg_shapes.html @@ -0,0 +1,12 @@ +<!-- Any copyright is dedicated to the Public Domain. + - http://creativecommons.org/publicdomain/zero/1.0/ --> + +<!DOCTYPE html> +<html> + <body> + <svg xmlns="http://www.w3.org/2000/svg" id="svg-element" width="200" height="200"> + <rect id="rect" x="100" y="100" width="20" height="20"></rect> + </svg> + <p id="text">ABC DEF GHI</p> + </body> +</html> diff --git a/testing/marionette/harness/marionette_harness/www/navigation_pushstate.html b/testing/marionette/harness/marionette_harness/www/navigation_pushstate.html new file mode 100644 index 0000000000..fbde792d8c --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/navigation_pushstate.html @@ -0,0 +1,20 @@ +<!-- 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/. --> + +<!DOCTYPE html> +<html> +<head> + <title>Navigation by manipulating the browser history</title> + <script type="text/javascript"> + function forward() { + let stateObj = { foo: "bar" }; + history.pushState(stateObj, "", "navigation_pushstate_target.html"); + } + </script> +</head> + +<body> + <p>Navigate <a onclick="javascript:forward();" id="forward">forward</a></p> +</body> +</html> diff --git a/testing/marionette/harness/marionette_harness/www/navigation_pushstate_target.html b/testing/marionette/harness/marionette_harness/www/navigation_pushstate_target.html new file mode 100644 index 0000000000..153d0a657f --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/navigation_pushstate_target.html @@ -0,0 +1,13 @@ +<!-- 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/. --> + +<!DOCTYPE html> +<html> +<head> +</head> + +<body> + <p id="target">Pushstate target</p> +</body> +</html> diff --git a/testing/marionette/harness/marionette_harness/www/nestedElements.html b/testing/marionette/harness/marionette_harness/www/nestedElements.html new file mode 100644 index 0000000000..618bf3231b --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/nestedElements.html @@ -0,0 +1,9 @@ +<!DOCTYPE html> +<a href="1.html">hello world</a> +<a href="1.html">hello world</a><a href="1.html">hello world</a> +<div name="div1"> + <a href="2.html" name="link1">hello world</a> + <a href="2.html" name="link2">hello world</a> +</div> + +<a href="1.html">hello world</a><a href="1.html">hello world</a><a href="1.html">hello world</a> diff --git a/testing/marionette/harness/marionette_harness/www/reftest/mostly-teal-700x700.html b/testing/marionette/harness/marionette_harness/www/reftest/mostly-teal-700x700.html new file mode 100644 index 0000000000..a5aa12d0d2 --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/reftest/mostly-teal-700x700.html @@ -0,0 +1,21 @@ +<!doctype html> +<style> + * { + margin: 0; + padding: 0; + } + + html { + background: teal; + } + + div { + position: absolute; + top: 600px; + left: 600px; + height: 100px; + width: 100px; + background: orange; + } +</style> +<div></div> diff --git a/testing/marionette/harness/marionette_harness/www/reftest/teal-700x700.html b/testing/marionette/harness/marionette_harness/www/reftest/teal-700x700.html new file mode 100644 index 0000000000..e441e88e6d --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/reftest/teal-700x700.html @@ -0,0 +1,21 @@ +<!doctype html> +<style> + * { + margin: 0; + padding: 0; + } + + html { + background: teal; + } + + div { + position: absolute; + top: 600px; + left: 600px; + height: 100px; + width: 100px; + background: transparent; + } +</style> +<div></div> diff --git a/testing/marionette/harness/marionette_harness/www/resultPage.html b/testing/marionette/harness/marionette_harness/www/resultPage.html new file mode 100644 index 0000000000..6e2fea9a14 --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/resultPage.html @@ -0,0 +1,16 @@ +<!-- 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/. --> + +<html> +<head> + <title>We Arrive Here</title> +</head> +<body> + + +<div> + <input type='text' id='email'/> +</div> +</body> +</html> diff --git a/testing/marionette/harness/marionette_harness/www/serviceworker/install_serviceworker.html b/testing/marionette/harness/marionette_harness/www/serviceworker/install_serviceworker.html new file mode 100644 index 0000000000..572a05c2bc --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/serviceworker/install_serviceworker.html @@ -0,0 +1,11 @@ +<!DOCTYPE html> +<html> + <head> + <title>Install Service Worker</title> + </head> + <body> + <script> + navigator.serviceWorker.register("serviceworker.js"); + </script> + </body> +</html> diff --git a/testing/marionette/harness/marionette_harness/www/serviceworker/serviceworker.js b/testing/marionette/harness/marionette_harness/www/serviceworker/serviceworker.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/serviceworker/serviceworker.js diff --git a/testing/marionette/harness/marionette_harness/www/shim.js b/testing/marionette/harness/marionette_harness/www/shim.js new file mode 100644 index 0000000000..9a8e09d6b6 --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/shim.js @@ -0,0 +1,297 @@ +/** + * mouse_event_shim.js: generate mouse events from touch events. + * + * This library listens for touch events and generates mousedown, mousemove + * mouseup, and click events to match them. It captures and dicards any + * real mouse events (non-synthetic events with isTrusted true) that are + * send by gecko so that there are not duplicates. + * + * This library does emit mouseover/mouseout and mouseenter/mouseleave + * events. You can turn them off by setting MouseEventShim.trackMouseMoves to + * false. This means that mousemove events will always have the same target + * as the mousedown even that began the series. You can also call + * MouseEventShim.setCapture() from a mousedown event handler to prevent + * mouse tracking until the next mouseup event. + * + * This library does not support multi-touch but should be sufficient + * to do drags based on mousedown/mousemove/mouseup events. + * + * This library does not emit dblclick events or contextmenu events + */ + +"use strict"; + +(function () { + // Make sure we don't run more than once + if (MouseEventShim) { + return; + } + + // Bail if we're not on running on a platform that sends touch + // events. We don't need the shim code for mouse events. + try { + document.createEvent("TouchEvent"); + } catch (e) { + return; + } + + let starttouch; // The Touch object that we started with + let target; // The element the touch is currently over + let emitclick; // Will we be sending a click event after mouseup? + + // Use capturing listeners to discard all mouse events from gecko + window.addEventListener("mousedown", discardEvent, true); + window.addEventListener("mouseup", discardEvent, true); + window.addEventListener("mousemove", discardEvent, true); + window.addEventListener("click", discardEvent, true); + + function discardEvent(e) { + if (e.isTrusted) { + e.stopImmediatePropagation(); // so it goes no further + if (e.type === "click") { + e.preventDefault(); + } // so it doesn't trigger a change event + } + } + + // Listen for touch events that bubble up to the window. + // If other code has called stopPropagation on the touch events + // then we'll never see them. Also, we'll honor the defaultPrevented + // state of the event and will not generate synthetic mouse events + window.addEventListener("touchstart", handleTouchStart); + window.addEventListener("touchmove", handleTouchMove); + window.addEventListener("touchend", handleTouchEnd); + window.addEventListener("touchcancel", handleTouchEnd); // Same as touchend + + function handleTouchStart(e) { + // If we're already handling a touch, ignore this one + if (starttouch) { + return; + } + + // Ignore any event that has already been prevented + if (e.defaultPrevented) { + return; + } + + // Sometimes an unknown gecko bug causes us to get a touchstart event + // for an iframe target that we can't use because it is cross origin. + // Don't start handling a touch in that case + try { + e.changedTouches[0].target.ownerDocument; + } catch (e) { + // Ignore the event if we can't see the properties of the target + return; + } + + // If there is more than one simultaneous touch, ignore all but the first + starttouch = e.changedTouches[0]; + target = starttouch.target; + emitclick = true; + + // Move to the position of the touch + emitEvent("mousemove", target, starttouch); + + // Now send a synthetic mousedown + let result = emitEvent("mousedown", target, starttouch); + + // If the mousedown was prevented, pass that on to the touch event. + // And remember not to send a click event + if (!result) { + e.preventDefault(); + emitclick = false; + } + } + + function handleTouchEnd(e) { + if (!starttouch) { + return; + } + + // End a MouseEventShim.setCapture() call + if (MouseEventShim.capturing) { + MouseEventShim.capturing = false; + MouseEventShim.captureTarget = null; + } + + for (let i = 0; i < e.changedTouches.length; i++) { + let touch = e.changedTouches[i]; + // If the ended touch does not have the same id, skip it + if (touch.identifier !== starttouch.identifier) { + continue; + } + + emitEvent("mouseup", target, touch); + + // If target is still the same element we started and the touch did not + // move more than the threshold and if the user did not prevent + // the mousedown, then send a click event, too. + if (emitclick) { + emitEvent("click", starttouch.target, touch); + } + + starttouch = null; + return; + } + } + + function handleTouchMove(e) { + if (!starttouch) { + return; + } + + for (let i = 0; i < e.changedTouches.length; i++) { + let touch = e.changedTouches[i]; + // If the ended touch does not have the same id, skip it + if (touch.identifier !== starttouch.identifier) { + continue; + } + + // Don't send a mousemove if the touchmove was prevented + if (e.defaultPrevented) { + return; + } + + // See if we've moved too much to emit a click event + let dx = Math.abs(touch.screenX - starttouch.screenX); + let dy = Math.abs(touch.screenY - starttouch.screenY); + if ( + dx > MouseEventShim.dragThresholdX || + dy > MouseEventShim.dragThresholdY + ) { + emitclick = false; + } + + let tracking = + MouseEventShim.trackMouseMoves && !MouseEventShim.capturing; + + let oldtarget; + let newtarget; + if (tracking) { + // If the touch point moves, then the element it is over + // may have changed as well. Note that calling elementFromPoint() + // forces a layout if one is needed. + // XXX: how expensive is it to do this on each touchmove? + // Can we listen for (non-standard) touchleave events instead? + oldtarget = target; + newtarget = document.elementFromPoint(touch.clientX, touch.clientY); + if (newtarget === null) { + // this can happen as the touch is moving off of the screen, e.g. + newtarget = oldtarget; + } + if (newtarget !== oldtarget) { + leave(oldtarget, newtarget, touch); // mouseout, mouseleave + target = newtarget; + } + } else if (MouseEventShim.captureTarget) { + target = MouseEventShim.captureTarget; + } + + emitEvent("mousemove", target, touch); + + if (tracking && newtarget !== oldtarget) { + enter(newtarget, oldtarget, touch); // mouseover, mouseenter + } + } + } + + // Return true if element a contains element b + function contains(a, b) { + return (a.compareDocumentPosition(b) & 16) !== 0; + } + + // A touch has left oldtarget and entered newtarget + // Send out all the events that are required + function leave(oldtarget, newtarget, touch) { + emitEvent("mouseout", oldtarget, touch, newtarget); + + // If the touch has actually left oldtarget (and has not just moved + // into a child of oldtarget) send a mouseleave event. mouseleave + // events don't bubble, so we have to repeat this up the hierarchy. + for (let e = oldtarget; !contains(e, newtarget); e = e.parentNode) { + emitEvent("mouseleave", e, touch, newtarget); + } + } + + // A touch has entered newtarget from oldtarget + // Send out all the events that are required. + function enter(newtarget, oldtarget, touch) { + emitEvent("mouseover", newtarget, touch, oldtarget); + + // Emit non-bubbling mouseenter events if the touch actually entered + // newtarget and wasn't already in some child of it + for (let e = newtarget; !contains(e, oldtarget); e = e.parentNode) { + emitEvent("mouseenter", e, touch, oldtarget); + } + } + + function emitEvent(type, target, touch, relatedTarget) { + let synthetic = document.createEvent("MouseEvents"); + let bubbles = type !== "mouseenter" && type !== "mouseleave"; + let count = + type === "mousedown" || type === "mouseup" || type === "click" ? 1 : 0; + + synthetic.initMouseEvent( + type, + bubbles, // canBubble + true, // cancelable + window, + count, // detail: click count + touch.screenX, + touch.screenY, + touch.clientX, + touch.clientY, + false, // ctrlKey: we don't have one + false, // altKey: we don't have one + false, // shiftKey: we don't have one + false, // metaKey: we don't have one + 0, // we're simulating the left button + relatedTarget || null + ); + + try { + return target.dispatchEvent(synthetic); + } catch (e) { + console.warn("Exception calling dispatchEvent", type, e); + return true; + } + } +})(); + +const MouseEventShim = { + // It is a known gecko bug that synthetic events have timestamps measured + // in microseconds while regular events have timestamps measured in + // milliseconds. This utility function returns a the timestamp converted + // to milliseconds, if necessary. + getEventTimestamp(e) { + if (e.isTrusted) { + // XXX: Are real events always trusted? + return e.timeStamp; + } + return e.timeStamp / 1000; + }, + + // Set this to false if you don't care about mouseover/out events + // and don't want the target of mousemove events to follow the touch + trackMouseMoves: true, + + // Call this function from a mousedown event handler if you want to guarantee + // that the mousemove and mouseup events will go to the same element + // as the mousedown even if they leave the bounds of the element. This is + // like setting trackMouseMoves to false for just one drag. It is a + // substitute for event.target.setCapture(true) + setCapture(target) { + this.capturing = true; // Will be set back to false on mouseup + if (target) { + this.captureTarget = target; + } + }, + + capturing: false, + + // Keep these in sync with ui.dragThresholdX and ui.dragThresholdY prefs. + // If a touch ever moves more than this many pixels from its starting point + // then we will not synthesize a click event when the touch ends. + dragThresholdX: 25, + dragThresholdY: 25, +}; diff --git a/testing/marionette/harness/marionette_harness/www/slow_resource.html b/testing/marionette/harness/marionette_harness/www/slow_resource.html new file mode 100644 index 0000000000..b87d9f4b86 --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/slow_resource.html @@ -0,0 +1,13 @@ +<!-- 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/. --> + +<!DOCTYPE html> +<html> +<head> +<title>Slow loading resource</title> +</head> +<body> + <img src="/slow?delay=4" id="slow" /> +</body> +</html> diff --git a/testing/marionette/harness/marionette_harness/www/test.html b/testing/marionette/harness/marionette_harness/www/test.html new file mode 100644 index 0000000000..20689a6d59 --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/test.html @@ -0,0 +1,43 @@ +<!-- 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/. --> + +<!DOCTYPE html> +<html> +<head> +<title>Marionette Test</title> +<style> +input[type=text], input[type=button] { + appearance: none; +} +</style> +</head> +<body> + <h1 id="testh1">Test Page</h1> + <script type="text/javascript"> + window.ready = true; + function addDelayedElement() { + setTimeout(createDiv, 2000); + function createDiv() { + let newDiv = document.createElement("div"); + newDiv.id = "newDiv"; + let newContent = document.createTextNode("I am a newly created div!"); + newDiv.appendChild(newContent); + document.body.appendChild(newDiv); + } + } + function clicked() { + let link = document.getElementById("mozLink"); + link.innerHTML = "Clicked"; + } + </script> + <a href="#" id="mozLink" class="linkClass" onclick="clicked()">Click me!</a> + <div id="testDiv"> + <a href="#" id="divLink" class="linkClass" onclick="clicked()">Div click me!</a> + <a href="#" id="divLink2" class="linkClass" onclick="clicked()">Div click me!</a> + </div> + <input name="myInput" type="text" value="asdf"/> + <input name="myCheckBox" type="checkbox" /> + <input id="createDivButton" type="button" value="create a div" onclick="addDelayedElement()" /> +</body> +</html> diff --git a/testing/marionette/harness/marionette_harness/www/testAction.html b/testing/marionette/harness/marionette_harness/www/testAction.html new file mode 100644 index 0000000000..404ce9809a --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/testAction.html @@ -0,0 +1,96 @@ +<!-- 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/. --> + +<!DOCTYPE html> + +<html> +<meta charset="UTF-8"> +<head> +<title>Marionette Test</title> +</head> +<body> + <h1 id="testh1">Test Page</h1> + <button id="button1" style="position:absolute;left:0px;top:55px;" type="button" allowevents=true>button1</button> + <button id="button2" style="position:absolute;left:0px;top:355px;" type="button" allowevents=true>button2</button> + <button id="button3" style="position:absolute;left:0px;top:455px;" type="button" allowevents=true>button3</button> + <button id="button4" style="position:absolute;left:100px;top:455px;" type="button" allowevents=true>button4</button> + <button id="buttonScroll" style="position:absolute;left:100px;top:855px;" type="button" allowevents=true>buttonScroll</button> + <h2 id="hidden" style="visibility: hidden" class="linkClass">Hidden</h2> + <button id="buttonFlick" style="position:absolute;left:0px;top:255px;" type="button" allowevents=true>buttonFlick</button> + <script type="text/javascript"> + let button3Timer = null; + let button4Timer = null; + //appends passed in text to the innerHTML of the event's target + function appendText(text) { + return function(evt) { + let element; + if (evt.type.includes("touch")) { + if (evt.type == "touchstart") { + element = evt.target; + } + else { + //since the target of touchstart is the target of all subsequent events, then + //changedTouches holds the current coordinates of this touch event, so we + //use these coordinates to find the element under the touch event + let touches = evt.changedTouches; + let x = touches[0].clientX; + let y = touches[0].clientY; + element = document.elementFromPoint(x,y); + } + } + //handle mouse events or contextmenu + else { + element = evt.target; + } + // eslint-disable-next-line no-unsanitized/property + element.innerHTML += text; + }; + }; + //use this function outside of attachListeners when you want to test sendMouseOnlyEvents on a target + function attachMouseListeners(element) { + element.addEventListener("contextmenu", appendText("-contextmenu")); + element.addEventListener("mousedown", appendText("-mousedown")); + element.addEventListener("mousemove", appendText("-mousemove")); + element.addEventListener("mouseup", appendText("-mouseup")); + element.addEventListener("click", appendText("-click")); + }; + function attachListeners(id) { + let element = document.getElementById(id); + element.addEventListener("touchstart", appendText("-touchstart")); + element.addEventListener("touchmove", appendText("-touchmove")); + element.addEventListener("touchend", appendText("-touchend")); + element.addEventListener("touchcancel", appendText("-touchcancel")); + attachMouseListeners(element); + }; + //for tracking time on an element + function addTimers(id, timer) { + let element = document.getElementById(id); + element.addEventListener("touchstart", function(evt) { timer = (new Date()).getTime();}); + // eslint-disable-next-line no-unsanitized/property + element.addEventListener("touchend", function(evt) { timer = (new Date()).getTime() - timer; evt.target.innerHTML += "-" + timer;}); + } + attachListeners("button1"); + attachListeners("button2"); + attachListeners("button3"); + attachListeners("button4"); + attachListeners("buttonScroll"); + addTimers("button3"); + addTimers("button4"); + const buttonFlick = document.getElementById("buttonFlick"); + attachMouseListeners(buttonFlick); + function createDelayed() { + let newButton = document.createElement("button"); + newButton.id = "delayed"; + newButton.setAttribute("style", "position:absolute;left:220px;top:455px;"); + let content = document.createTextNode("delayed"); + newButton.appendChild(content); + document.body.appendChild(newButton); + newButton.addEventListener("mousemove", appendText("-mousemove")); + newButton.addEventListener("mouseup", appendText("-mouseup")); + newButton.addEventListener("click", appendText("-click")); + }; + window.setTimeout(createDelayed, 5000); + </script> +</body> +</html> diff --git a/testing/marionette/harness/marionette_harness/www/test_accessibility.html b/testing/marionette/harness/marionette_harness/www/test_accessibility.html new file mode 100644 index 0000000000..8cc9fd6493 --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/test_accessibility.html @@ -0,0 +1,57 @@ +<!-- 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/. --> + +<!DOCTYPE html> + +<html> +<meta charset="UTF-8"> +<head> +<title>Marionette Test</title> +</head> +<body> + <button id="button1">button1</button> + <button id="button2" aria-label="button2"></button> + <span id="button3">I am a bad button with no accessible</span> + <h1 id="button4">I am a bad button that is actually a header</h1> + <h1 id="button5"> + I am a bad button that is actually an actionable header with a listener + </h1> + <button id="button6"></button> + <button id="button7" aria-hidden="true">button7</button> + <div aria-hidden="true"> + <button id="button8">button8</button> + </div> + <button id="button9" style="position:absolute;left:-100px;top:-455px;"> + button9 + </button> + <button id="button10" style="visibility:hidden;"> + button10 + </button> + <span id="no_accessible_but_displayed">I have no accessible object</span> + <button id="button11" disabled>button11</button> + <button id="button12" aria-disabled="true">button12</button> + <span id="no_accessible_but_disabled" disabled>I have no accessible object</span> + <span id="button13" tabindex="0" role="button" aria-label="Span button">Span button</span> + <span id="button14" role="button" aria-label="Span button">Unexplorable Span button</span> + <button id="button15" style="pointer-events:none;">button15</button> + <div style="pointer-events:none;"> + <button id="button16">button16</button> + </div> + <div style="pointer-events:none;"> + <button style="pointer-events:all;" id="button17">button17</button> + </div> + <input id="input1" title="My Input 1" name="myInput1" type="text" value="asdf"/> + <select> + <option id="option1" value="val1">Val1</option> + <option id="option2" value="val2" selected>Val2</option> + </select> + <script> + 'use strict'; + document.getElementById('button5').addEventListener('click', function() { + // A pseudo button that has a listener but is missing button semantics. + return true; + }); + </script> +</body> +</html> diff --git a/testing/marionette/harness/marionette_harness/www/test_clearing.html b/testing/marionette/harness/marionette_harness/www/test_clearing.html new file mode 100644 index 0000000000..2aa3c6a21f --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/test_clearing.html @@ -0,0 +1,24 @@ +<html> + <!-- 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/. --> + <body> + <input id="writableTextInput" type="text" value="Test"/> + + <input id="readOnlyTextInput" type="text" readonly value="Test"/> + + <input id="textInputnotenabled" type="text" disabled="true" value="Test"/> + + <textarea id="writableTextArea" rows="2" cols="20"> + This is a sample text area which is supposed to be cleared + </textarea> + + <textarea id="textAreaReadOnly" readonly rows="5" cols="20"> + text area which is not supposed to be cleared</textarea> + + <textarea rows="5" id="textAreaNotenabled" disabled="true" cols="20"> + text area which is not supposed to be cleared</textarea> + + <div id="content-editable" contentEditable="true">This is a contentEditable area</div> + </body> +</html> diff --git a/testing/marionette/harness/marionette_harness/www/test_dynamic.html b/testing/marionette/harness/marionette_harness/www/test_dynamic.html new file mode 100644 index 0000000000..504e7e74ba --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/test_dynamic.html @@ -0,0 +1,38 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" + "http://www.w3.org/TR/html4/loose.dtd"> +<html> + <head> + <title></title> + <script type="text/javascript"> + let next = 0; + + function addMore() { + let box = document.createElement('DIV'); + box.id = 'box' + next++; + box.className = 'redbox'; + box.style.width = '150px'; + box.style.height = '150px'; + box.style.backgroundColor = 'red'; + box.style.border = '1px solid black'; + box.style.margin = '5px'; + window.setTimeout(function() { + document.body.appendChild(box); + }, 1000); + } + + function reveal() { + let elem = document.getElementById('revealed'); + window.setTimeout(function() { + elem.style.display = ''; + }, 1000); + } + </script> + </head> + <body> + <input id="adder" type="button" value="Add a box!" onclick="addMore()"/> + + <input id="reveal" type="button" value="Reveal a new input" onclick="reveal();" /> + + <input id="revealed" style="display:none;" /> + </body> + </html> diff --git a/testing/marionette/harness/marionette_harness/www/test_iframe.html b/testing/marionette/harness/marionette_harness/www/test_iframe.html new file mode 100644 index 0000000000..b323ace679 --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/test_iframe.html @@ -0,0 +1,16 @@ +<!-- 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/. --> + +<!doctype html> +<html> +<head> +<title>Marionette IFrame Test</title> +</head> +<body> + <h1 id="iframe_page_heading">This is the heading</h1> + + <iframe src="test.html" id="test_iframe"></iframe> + <iframe src="test.html" id="test_iframe" name="test_iframe_name"></iframe> +</body> +</html> diff --git a/testing/marionette/harness/marionette_harness/www/test_inner_iframe.html b/testing/marionette/harness/marionette_harness/www/test_inner_iframe.html new file mode 100644 index 0000000000..8c9810d0bb --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/test_inner_iframe.html @@ -0,0 +1,13 @@ +<!-- 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/. --> + +<!doctype html> +<html> +<head> +<title>Inner Iframe</title> +</head> +<body> + <iframe src="test.html" id="inner_frame"></iframe> +</body> +</html> diff --git a/testing/marionette/harness/marionette_harness/www/test_nested_iframe.html b/testing/marionette/harness/marionette_harness/www/test_nested_iframe.html new file mode 100644 index 0000000000..49ac1b0ba5 --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/test_nested_iframe.html @@ -0,0 +1,13 @@ +<!-- 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/. --> + +<!doctype html> +<html> +<head> +<title>Marionette IFrame Test</title> +</head> +<body> + <iframe src="test_inner_iframe.html" id="test_iframe"></iframe> +</body> +</html> diff --git a/testing/marionette/harness/marionette_harness/www/test_oop_1.html b/testing/marionette/harness/marionette_harness/www/test_oop_1.html new file mode 100644 index 0000000000..29add714cd --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/test_oop_1.html @@ -0,0 +1,14 @@ +<!-- 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/. --> + +<!DOCTYPE html> +<html> +<head> +<title>OOP Test Frame 1</title> +</head> +<body> + <h1 id="testh1">OOP Test Frame 1</h1> + Hello! +</body> +</html> diff --git a/testing/marionette/harness/marionette_harness/www/test_oop_2.html b/testing/marionette/harness/marionette_harness/www/test_oop_2.html new file mode 100644 index 0000000000..6e5a4962fb --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/test_oop_2.html @@ -0,0 +1,14 @@ +<!-- 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/. --> + +<!DOCTYPE html> +<html> +<head> +<title>OOP Test Frame 2</title> +</head> +<body> + <h1 id="testh1">OOP Test Frame 2</h1> + Hello! +</body> +</html> diff --git a/testing/marionette/harness/marionette_harness/www/test_windows.html b/testing/marionette/harness/marionette_harness/www/test_windows.html new file mode 100644 index 0000000000..f3759990c0 --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/test_windows.html @@ -0,0 +1,13 @@ +<?xml version="1.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/. --> + +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>XHTML Test Page</title> +</head> +<body> + <p><a href="resultPage.html" onClick='javascript:window.open("resultPage.html",null, "menubar=0,location=1,resizable=1,scrollbars=1,status=0,width=700,height=375");' name="windowOne">Open new window</a></p> +</body> +</html> diff --git a/testing/marionette/harness/marionette_harness/www/update/complete.mar b/testing/marionette/harness/marionette_harness/www/update/complete.mar Binary files differnew file mode 100644 index 0000000000..375fd7bd08 --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/update/complete.mar diff --git a/testing/marionette/harness/marionette_harness/www/update/complete.mar.headers b/testing/marionette/harness/marionette_harness/www/update/complete.mar.headers new file mode 100644 index 0000000000..bcf051e2c7 --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/update/complete.mar.headers @@ -0,0 +1 @@ +Content-Length: 86612 diff --git a/testing/marionette/harness/marionette_harness/www/visibility.html b/testing/marionette/harness/marionette_harness/www/visibility.html new file mode 100644 index 0000000000..2296f3cd46 --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/visibility.html @@ -0,0 +1,51 @@ +<?xml version="1.0"?> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> + <!-- 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/. --> +<head> + <title>Testing Visibility</title> +</head> + +<body> + +<div> + <span id="hideMe" onclick="this.style.display = 'none';">Click to hide me.</span> +</div> + +<div id="zero" style="width:0;height:0"> + <div> + <img src="map.png"> + </div> +</div> + +<p id="suppressedParagraph" style="display: none">A paragraph suppressed using CSS display=none</p> + +<div> + <p id="displayed">Displayed</p> + + <form action="#"><input type="hidden" name="hidden" /> </form> + + <p id="none" style="display: none;">Display set to none</p> + + <p id="hidden" style="visibility: hidden;">Hidden</p> + + <div id="hiddenparent" style="height: 2em; display: none;"> + <div id="hiddenchild"> + <a href="#" id="hiddenlink">ok</a> + </div> + </div> + + <div style="visibility: hidden;"> + <span> + <input id="unclickable" /> + <input type="checkbox" id="untogglable" checked="checked" />Check box you can't see + </span> + </div> + + <p id="outer" style="visibility: hidden">A <b id="visibleSubElement" style="visibility: visible">sub-element that is explicitly visible</b> using CSS visibility=visible</p> +</div> + +<input type='text' id='notDisplayed' style='display:none'> +</body> +</html> diff --git a/testing/marionette/harness/marionette_harness/www/white.png b/testing/marionette/harness/marionette_harness/www/white.png Binary files differnew file mode 100644 index 0000000000..8a68c11548 --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/white.png diff --git a/testing/marionette/harness/marionette_harness/www/windowHandles.html b/testing/marionette/harness/marionette_harness/www/windowHandles.html new file mode 100644 index 0000000000..bcd0b08dc3 --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/windowHandles.html @@ -0,0 +1,16 @@ +<!-- 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/. --> + +<!DOCTYPE html> +<html> +<head> +<title>Marionette New Tab Link</title> +</head> +<body> + <a href="empty.html" id="new-tab" target="_blank">New Tab</a> + <a href="about:blank" id="new-blank-tab" target="_blank">New blank Tab</a> + + <a href="" id="new-window" onClick='javascript:window.open("empty.html", null, "location=1,toolbar=1");'>New Window</a> +</body> +</html> diff --git a/testing/marionette/harness/marionette_harness/www/xhtmlTest.html b/testing/marionette/harness/marionette_harness/www/xhtmlTest.html new file mode 100644 index 0000000000..30940c709e --- /dev/null +++ b/testing/marionette/harness/marionette_harness/www/xhtmlTest.html @@ -0,0 +1,79 @@ +<?xml version="1.0"?> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> + <!-- 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/. --> +<head> + <title>XHTML Test Page</title> +</head> +<body> +<div class="navigation"> + <p><a href="resultPage.html" target="result" name="windowOne">Open new window</a></p> + <p><a href="iframes.html" target="_blank" name="windowTwo">Create a new anonymous window</a></p> + <p><a href="test_iframe.html" name="sameWindow">Open page with iframes in same window</a></p> + <p><a href="test.html" target="result" name="windowThree">Open a window with a close button</a></p> +</div> + +<a name="notext"><b></b></a> + +<div class="content"> + <h1 class="header">XHTML Might Be The Future</h1> + + <p>If you'd like to go elsewhere then <a href="resultPage.html">click me</a>.</p> + + <p>Alternatively, <a href="resultPage.html" id="linkId">this goes to the same place</a>.</p> + + <form name="someForm"> + <input id="username" type="text" value="change"/> + </form> + + This link has the same text as another link: <a href="resultPage.html">click me</a>. +</div> + +<div class="extraDiv">Another div starts here.<p/> + <h2 class="nameA nameBnoise nameC">An H2 title</h2> + <p class="nameC">Some more text</p> +</div> + +<div> + <a id="id1" href="#">Foo</a> + <ul id="id2" /> + <span id="id3"/> +</div> + +<div> + <table id="table" ></table> +</div> + +<span id="amazing"> +<div> + <div> + <div> + <span/> + <a>I have width</a> + </div> + </div> +</div> +</span> + +<a name="text" /> +<p id="spaces"> </p> +<p id="empty"></p> +<a href="foo" id="linkWithEqualsSign">Link=equalssign</a> + +<p class=" spaceAround ">Spaced out</p> + +<span id="my_span"> + <div>first_div</div> + <div>second_div</div> + <span>first_span</span> + <span>second_span</span> +</span> + +<div id="parent">I'm a parent + <div id="child">I'm a child</div> +</div> + +<div id="only-exists-on-xhtmltest">Woo woo</div> +</body> +</html> |