Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Side by Side Diff: content/test/data/simple_links.html

Issue 715203004: PlzNavigate: Add a browser test for basic navigations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added a browser test for renderer initiated navigations Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <html>
2
3 <head><title>Simple links</title>
4 <script>
5 function simulateClick(target) {
6 var evt = document.createEvent("MouseEvents");
7 evt.initMouseEvent("click", true, true, window,
8 0, 0, 0, 0, 0, false, false,
9 false, false, 0, null);
10
11 return target.dispatchEvent(evt);
12 }
13
14 function clickSameSiteLink() {
15 return simulateClick(document.getElementById("same_site_link"));
16 }
17
18 function clickCrossSiteLink() {
19 return simulateClick(
20 document.getElementById("cross_site_link"));
21 }
22
23 // Listen to incoming messages and reply to them.
nasko 2014/11/24 23:15:00 Is any of this code that follows actually used? If
clamy 2014/11/26 12:47:43 Done.
24 var receivedMessages = 0;
25 window.addEventListener("message", messageReceived, false);
26 function messageReceived(event) {
27 receivedMessages++;
28 event.source.postMessage(event.data, "*");
29 }
30
31 // Send a message which contains a message port.
32 var mc;
33 function postWithPortToFoo() {
34 mc = new MessageChannel();
35 mc.port1.onmessage = portMessageReceived;
36 mc.port1.start();
37 var w = window.open("", "foo");
38 w.postMessage({message: "msg-with-port", port: mc.port2}, "*", [mc.port2]);
39 return true;
40 }
41
42 var receivedMessagesViaPort = 0;
43 function portMessageReceived(event) {
44 receivedMessagesViaPort++;
45 // Change the title to generate a notification.
46 document.title = event.data;
47 }
48 </script>
49 </head>
50
51 <a href="title2.html" id="same_site_link">same-site</a><br>
52 <a href="http://foo.com/title2.html" id="cross_site_link">cross-site</a><br>
53
54 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698