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

Unified Diff: ios/testing/data/http_server_files/window_location.js

Issue 2799953002: Treat loads of invalid URLs as no-ops unless triggered by window.open. (Closed)
Patch Set: Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: ios/testing/data/http_server_files/window_location.js
diff --git a/ios/testing/data/http_server_files/window_location.js b/ios/testing/data/http_server_files/window_location.js
index 7e1bc1975973957141deecf8576472d8808cbdba..d89e17fa506d26fab51d2ee23ad846fd185fab52 100644
--- a/ios/testing/data/http_server_files/window_location.js
+++ b/ios/testing/data/http_server_files/window_location.js
@@ -11,10 +11,22 @@ var updateOnLoadText = function(text) {
document.getElementById('on-load-div').innerHTML = text;
}
+var updateNoOpText = function() {
+ document.getElementById('no-op').innerHTML = 'NoOpText';
+}
+
+var buttonWasTapped = function() {
+ setTimeout(updateNoOpText, 500);
+}
+
var isOnLoadTextVisible = function() {
return document.getElementById('on-load-div').innerHTML == 'OnLoadText';
}
+var isNoOpTextVisible = function() {
+ return document.getElementById('no-op').innerHTML == 'NoOpText';
+}
+
// Updates the url-to-load div with |text|. This value is later used by the
// window.location calls below.
var updateUrlToLoadText = function(text) {
@@ -30,20 +42,24 @@ var getUrl = function() {
var locationAssign = function() {
updateOnLoadText('');
window.location.assign(getUrl());
+ buttonWasTapped();
Eugene But (OOO till 7-30) 2017/04/06 18:34:19 |locationAssign| and other methods are named in ge
kkhorimoto 2017/04/07 00:03:40 Done.
}
var locationReplace = function() {
updateOnLoadText('');
window.location.replace(getUrl());
+ buttonWasTapped();
}
var locationReload = function() {
updateOnLoadText('');
window.location.reload();
+ buttonWasTapped();
}
var setLocationToDOMString = function() {
updateOnLoadText('');
window.location = getUrl();
+ buttonWasTapped();
}

Powered by Google App Engine
This is Rietveld 408576698