summaryrefslogtreecommitdiffstats
path: root/content/test/browser_test_utils.cc
diff options
context:
space:
mode:
Diffstat (limited to 'content/test/browser_test_utils.cc')
-rw-r--r--content/test/browser_test_utils.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/content/test/browser_test_utils.cc b/content/test/browser_test_utils.cc
index 74f152b..6b194f8 100644
--- a/content/test/browser_test_utils.cc
+++ b/content/test/browser_test_utils.cc
@@ -12,6 +12,7 @@
#include "base/string_number_conversions.h"
#include "base/test/test_timeouts.h"
#include "base/utf_string_conversions.h"
+#include "net/base/net_util.h"
#include "content/public/browser/dom_operation_notification_details.h"
#include "content/public/browser/notification_types.h"
#include "content/public/browser/render_view_host.h"
@@ -146,6 +147,18 @@ void BuildSimpleWebKeyEvent(WebKit::WebInputEvent::Type type,
} // namespace
+
+GURL GetFileUrlWithQuery(const FilePath& path,
+ const std::string& query_string) {
+ GURL url = net::FilePathToFileURL(path);
+ if (!query_string.empty()) {
+ GURL::Replacements replacements;
+ replacements.SetQueryStr(query_string);
+ return url.ReplaceComponents(replacements);
+ }
+ return url;
+}
+
void SimulateMouseClick(WebContents* web_contents) {
int x = web_contents->GetView()->GetContainerSize().width() / 2;
int y = web_contents->GetView()->GetContainerSize().height() / 2;