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

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: added functions Created 3 years, 12 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 | « 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 isOnLoadTextVisible = function() {
15 return document.getElementById('on-load-div').innerHTML == 'OnLoadText';
16 }
17
18 // Updates the url-to-load div with |text|. This value is later used by the
19 // window.location calls below.
20 var updateUrlToLoadText = function(text) {
21 document.getElementById('url-to-load').innerHTML = text;
22 }
23
24 // Returns a DOMString representing the URL used as the innerHTML of the
25 // url-to-load div.
26 var getUrl = function() {
27 return document.getElementById('url-to-load').innerHTML;
28 }
29
30 var locationAssign = function() {
31 updateOnLoadText('');
32 window.location.assign(getUrl());
33 }
34
35 var locationReplace = function() {
36 updateOnLoadText('');
37 window.location.replace(getUrl());
38 }
39
40 var locationReload = function() {
41 updateOnLoadText('');
42 window.location.reload();
43 }
44
45 var setLocationToDOMString = function() {
46 updateOnLoadText('');
47 window.location = getUrl();
48 }
49
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