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

Side by Side Diff: ios/testing/data/http_server_files/window_location.js

Issue 2577333002: Created file-based test pages for window.location tests. (Closed)
Patch Set: Created 4 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
« no previous file with comments | « ios/testing/data/http_server_files/window_location.html ('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 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Adds event listeners and populates on-load-div.
6 window.onload = function() {
7 updateOnLoadText('OnLoadText');
8 };
9
10 var updateOnLoadText = function(text) {
11 document.getElementById('on-load-div').innerHTML = text;
12 }
13
14 var updateURLToLoadText = function(text) {
Eugene But (OOO till 7-30) 2016/12/16 03:38:11 nit: s/URL/Url per JS Style Guide
kkhorimoto 2016/12/20 23:23:45 Done.
15 document.getElementById('url-to-load').innerHTML = text;
16 }
17
18 // Returns a DOMString representing the URL used as the innerHTML of the
19 // url-to-load div.
20 var getURL = function() {
Eugene But (OOO till 7-30) 2016/12/16 03:38:11 ditto
kkhorimoto 2016/12/20 23:23:45 Done.
21 return document.getElementById('url-to-load').innerHTML;
22 }
23
24 var locationAssign = function() {
25 updateOnLoadText('');
26 window.location.assign(getURL());
27 }
28
29 var locationReplace = function() {
30 updateOnLoadText('');
31 window.location.replace(getURL());
32 }
33
34 var locationReload = function() {
35 updateOnLoadText('');
36 window.location.reload();
37 }
38
39 var setLocationToDOMString = function() {
40 updateOnLoadText('');
41 window.location = getURL();
42 }
43
OLDNEW
« no previous file with comments | « ios/testing/data/http_server_files/window_location.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698