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

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

Issue 2583733002: Add functionality to window.history.go test page. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/testing/data/http_server_files/history_go.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/testing/data/http_server_files/history_go.js
diff --git a/ios/testing/data/http_server_files/history_go.js b/ios/testing/data/http_server_files/history_go.js
index 543f18649e8ca43edf8f9b41db16cee7f6b58f96..7e04f35eb0aa6f5a9663f1d7887ec54922784dbc 100644
--- a/ios/testing/data/http_server_files/history_go.js
+++ b/ios/testing/data/http_server_files/history_go.js
@@ -12,7 +12,8 @@ window.onload = function() {
// Populates pop-state-received-div and state-object-div upon a popstate event.
var onPopstate = function(e) {
updatePopStateReceivedText(true);
- updateStateObjectText(e.state);
+ var stateText = e.state ? e.state : '(NO STATE OBJECT)';
+ updateStateObjectText(stateText);
};
// Populates hash-change-received-div upon receiving of a hashchange event.
@@ -64,6 +65,16 @@ var goZero = function() {
window.history.go(0);
}
+var goBack = function() {
+ onButtonTapped();
+ window.history.back();
+}
+
+var goForward = function() {
+ onButtonTapped();
+ window.history.forward();
+}
+
var go2 = function() {
onButtonTapped();
window.history.go(2);
@@ -73,3 +84,8 @@ var goBack2 = function() {
onButtonTapped();
window.history.go(-2);
}
+
+var pushStateWithHash = function() {
+ onButtonTapped();
+ window.history.pushState('STATE_OBJECT', 'Title', '#hash');
+}
« no previous file with comments | « ios/testing/data/http_server_files/history_go.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698