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

Unified Diff: chrome_frame/test/data/chrome_frame_tester_helpers.js

Issue 3656002: Rewrite text field context menu tests using accessiblity framework.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 10 years, 1 month 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: chrome_frame/test/data/chrome_frame_tester_helpers.js
===================================================================
--- chrome_frame/test/data/chrome_frame_tester_helpers.js (revision 65066)
+++ chrome_frame/test/data/chrome_frame_tester_helpers.js (working copy)
@@ -159,3 +159,33 @@
}
return url;
}
+
+// Get the value of the first parameter from the query string which matches the
+// given name.
+function getURLParameter(name) {
+ name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
+ var regexString = "[\\?&]" + name + "=([^&#]*)";
+ var regex = new RegExp(regexString);
+ var results = regex.exec(window.location.href);
+ if (results == null) {
+ return "";
+ } else {
+ return results[1];
+ }
+}
+
+// Create new URL by given html page name and querystring, based on current URL
+// path.
+function buildURL(pageName, queryString) {
+ var path = window.location.pathname;
+ var url = "";
+
+ url += window.location.protocol + "//" + window.location.host;
+ if (path.lastIndexOf("/") > 0) {
+ url += path.substring(0, path.lastIndexOf("/")) + "/" + pageName;
+ } else {
+ url += "/" + pageName;
+ }
+ url += ((queryString == "") ? "" : "?" + queryString);
+ return url;
+}

Powered by Google App Engine
This is Rietveld 408576698