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

Side by Side Diff: chrome/test/data/chromedriver/xmlrequest_test.html

Issue 2065733002: Add a method to override the network conditions of the ChromeDriver session. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved fuction to top of setNetworkConnection Created 4 years, 5 months 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
« no previous file with comments | « chrome/test/chromedriver/test/run_py_tests.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 </head>
6 <body>
7 <span id='requestButton'>
8 Make a request
9 </span>
10 <a id="link" target="_blank" href="empty.html">Link to empty.html</a>
11
12 <p>Successes:
13 <div id="successes">
14 </div>
15
16 <p>Failures:
17 <div id="failures">
18 </div>
19 <script type="text/javascript">
20 var eventListener = function(evt) {
21 if( evt == 'success'){
22 document.getElementById("successes").innerHTML = ++successes;
23 } else if( evt == 'failure') {
24 document.getElementById("failures").innerHTML = ++failures;
25 }
26 };
27
28 var s = document.getElementById('successes');
29 var f = document.getElementById('failures');
30
31 s.addEventListener('click', function() { eventListener('success') });
32 f.addEventListener('click', function() { eventListener('failure') });
33
34 var httpRequest;
35 document.getElementById('requestButton').addEventListener('click', repeatL oadPage);
36
37 function makeRequest() {
38 httpRequest = new XMLHttpRequest();
39 url = window.location.protocol + "//" + window.location.host + "/hellowo rld";
40 httpRequest.onreadystatechange = alertContents;
41 httpRequest.open("GET", url);
42 httpRequest.send();
43 }
44
45 var successes = 0;
46 var failures = 0;
47
48 function alertContents() {
49 if (httpRequest.readyState == 4) {
50 if (httpRequest.status == 200) {
51 document.getElementById("successes").click();
52 successes++;
53 } else {
54 document.getElementById("failures").click();
55 failures++;
56 }
57 }
58 }
59
60 function repeatLoadPage() {
61 setInterval(makeRequest, 300);
62 }
63 </script>
64 </body>
65 </html>
OLDNEW
« no previous file with comments | « chrome/test/chromedriver/test/run_py_tests.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698