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

Unified Diff: chrome/browser/loadtimes_extension_bindings_browsertest.cc

Issue 10795090: Move ExecuteJavaScript functions from ui_test_utils.h to browser_test_utils.h so they can be reused… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 5 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: chrome/browser/loadtimes_extension_bindings_browsertest.cc
===================================================================
--- chrome/browser/loadtimes_extension_bindings_browsertest.cc (revision 148111)
+++ chrome/browser/loadtimes_extension_bindings_browsertest.cc (working copy)
@@ -7,6 +7,7 @@
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
#include "content/public/browser/web_contents.h"
+#include "content/public/test/browser_test_utils.h"
#include "net/test/test_server.h"
class LoadtimesExtensionBindingsTest : public InProcessBrowserTest {
@@ -19,7 +20,7 @@
// zero it out so the test is stable.
content::RenderViewHost* rvh =
chrome::GetActiveWebContents(browser())->GetRenderViewHost();
- ASSERT_TRUE(ui_test_utils::ExecuteJavaScript(
+ ASSERT_TRUE(content::ExecuteJavaScript(
rvh, L"",
L"window.before.firstPaintAfterLoadTime = 0;"
L"window.before.firstPaintTime = 0;"
@@ -28,10 +29,10 @@
std::string before;
std::string after;
- ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString(
+ ASSERT_TRUE(content::ExecuteJavaScriptAndExtractString(
rvh, L"", L"window.domAutomationController.send("
L"JSON.stringify(before))", &before));
- ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString(
+ ASSERT_TRUE(content::ExecuteJavaScriptAndExtractString(
rvh, L"", L"window.domAutomationController.send("
L"JSON.stringify(after))", &after));
EXPECT_EQ(before, after);
@@ -45,11 +46,11 @@
ui_test_utils::NavigateToURL(browser(), plain_url);
content::RenderViewHost* rvh =
chrome::GetActiveWebContents(browser())->GetRenderViewHost();
- ASSERT_TRUE(ui_test_utils::ExecuteJavaScript(
+ ASSERT_TRUE(content::ExecuteJavaScript(
rvh, L"", L"window.before = window.chrome.loadTimes()"));
- ASSERT_TRUE(ui_test_utils::ExecuteJavaScript(
+ ASSERT_TRUE(content::ExecuteJavaScript(
rvh, L"", L"window.location.href = window.location + \"#\""));
- ASSERT_TRUE(ui_test_utils::ExecuteJavaScript(
+ ASSERT_TRUE(content::ExecuteJavaScript(
rvh, L"", L"window.after = window.chrome.loadTimes()"));
CompareBeforeAndAfter();
}
@@ -62,10 +63,10 @@
ui_test_utils::NavigateToURL(browser(), plain_url);
content::RenderViewHost* rvh =
chrome::GetActiveWebContents(browser())->GetRenderViewHost();
- ASSERT_TRUE(ui_test_utils::ExecuteJavaScript(
+ ASSERT_TRUE(content::ExecuteJavaScript(
rvh, L"", L"window.before = window.chrome.loadTimes()"));
ui_test_utils::NavigateToURL(browser(), hash_url);
- ASSERT_TRUE(ui_test_utils::ExecuteJavaScript(
+ ASSERT_TRUE(content::ExecuteJavaScript(
rvh, L"", L"window.after = window.chrome.loadTimes()"));
CompareBeforeAndAfter();
}
« no previous file with comments | « chrome/browser/instant/instant_browsertest.cc ('k') | chrome/browser/net/load_timing_observer_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698