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

Unified Diff: chrome/browser/ssl/ssl_browser_tests.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/ssl/ssl_browser_tests.cc
===================================================================
--- chrome/browser/ssl/ssl_browser_tests.cc (revision 148111)
+++ chrome/browser/ssl/ssl_browser_tests.cc (working copy)
@@ -164,7 +164,7 @@
while (base::Time::Now() < timeToQuit) {
bool workerFinished = false;
- ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool(
+ ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool(
tab->GetRenderViewHost(), std::wstring(),
L"window.domAutomationController.send(IsWorkerFinished());",
&workerFinished));
@@ -181,7 +181,7 @@
}
bool actuallyLoadedContent = false;
- ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool(
+ ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool(
tab->GetRenderViewHost(), std::wstring(),
L"window.domAutomationController.send(IsContentLoaded());",
&actuallyLoadedContent));
@@ -735,7 +735,7 @@
EXPECT_EQ(0, GetConstrainedWindowCount());
int img_width;
- EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractInt(
+ EXPECT_TRUE(content::ExecuteJavaScriptAndExtractInt(
tab->GetRenderViewHost(), std::wstring(),
L"window.domAutomationController.send(ImageWidth());", &img_width));
// In order to check that the image was not loaded, we check its width.
@@ -744,7 +744,7 @@
EXPECT_LT(img_width, 100);
bool js_result = false;
- EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool(
+ EXPECT_TRUE(content::ExecuteJavaScriptAndExtractBool(
tab->GetRenderViewHost(), std::wstring(),
L"window.domAutomationController.send(IsFooSet());", &js_result));
EXPECT_FALSE(js_result);
@@ -769,7 +769,7 @@
// Load the insecure image.
bool js_result = false;
- EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool(
+ EXPECT_TRUE(content::ExecuteJavaScriptAndExtractBool(
tab->GetRenderViewHost(), std::wstring(), L"loadBadImage();",
&js_result));
EXPECT_TRUE(js_result);
@@ -1171,7 +1171,7 @@
content::WindowedNotificationObserver observer(
content::NOTIFICATION_LOAD_STOP,
content::Source<NavigationController>(&tab->GetController()));
- EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool(
+ EXPECT_TRUE(content::ExecuteJavaScriptAndExtractBool(
tab->GetRenderViewHost(), std::wstring(),
L"window.domAutomationController.send(clickLink('goodHTTPSLink'));",
&success));
@@ -1187,7 +1187,7 @@
content::WindowedNotificationObserver observer(
content::NOTIFICATION_LOAD_STOP,
content::Source<NavigationController>(&tab->GetController()));
- EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool(
+ EXPECT_TRUE(content::ExecuteJavaScriptAndExtractBool(
tab->GetRenderViewHost(), std::wstring(),
L"window.domAutomationController.send(clickLink('badHTTPSLink'));",
&success));
@@ -1203,7 +1203,7 @@
std::wstring content_frame_xpath(L"html/frameset/frame[2]");
std::wstring is_evil_js(L"window.domAutomationController.send("
L"document.getElementById('evilDiv') != null);");
- EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool(
+ EXPECT_TRUE(content::ExecuteJavaScriptAndExtractBool(
tab->GetRenderViewHost(), content_frame_xpath, is_evil_js,
&is_content_evil));
EXPECT_FALSE(is_content_evil);
@@ -1223,7 +1223,7 @@
content::WindowedNotificationObserver observer(
content::NOTIFICATION_LOAD_STOP,
content::Source<NavigationController>(&tab->GetController()));
- EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool(
+ EXPECT_TRUE(content::ExecuteJavaScriptAndExtractBool(
tab->GetRenderViewHost(), std::wstring(),
L"window.domAutomationController.send(clickLink('HTTPLink'));",
&success));
@@ -1270,7 +1270,7 @@
content::WindowedNotificationObserver observer(
content::NOTIFICATION_LOAD_STOP,
content::Source<NavigationController>(&tab->GetController()));
- EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool(
+ EXPECT_TRUE(content::ExecuteJavaScriptAndExtractBool(
tab->GetRenderViewHost(), std::wstring(),
L"window.domAutomationController.send(clickLink('goodHTTPSLink'));",
&success));
@@ -1307,7 +1307,7 @@
content::WindowedNotificationObserver observer(
content::NOTIFICATION_LOAD_STOP,
content::Source<NavigationController>(&tab->GetController()));
- EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool(
+ EXPECT_TRUE(content::ExecuteJavaScriptAndExtractBool(
tab->GetRenderViewHost(), std::wstring(),
L"window.domAutomationController.send(clickLink('goodHTTPSLink'));",
&success));
@@ -1324,7 +1324,7 @@
content::WindowedNotificationObserver observer(
content::NOTIFICATION_LOAD_STOP,
content::Source<NavigationController>(&tab->GetController()));
- EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool(
+ EXPECT_TRUE(content::ExecuteJavaScriptAndExtractBool(
tab->GetRenderViewHost(), std::wstring(),
L"window.domAutomationController.send(clickLink('badHTTPSLink'));",
&success));
@@ -1340,7 +1340,7 @@
std::wstring content_frame_xpath(L"html/frameset/frame[2]");
std::wstring is_evil_js(L"window.domAutomationController.send("
L"document.getElementById('evilDiv') != null);");
- EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool(
+ EXPECT_TRUE(content::ExecuteJavaScriptAndExtractBool(
tab->GetRenderViewHost(), content_frame_xpath, is_evil_js,
&is_content_evil));
EXPECT_FALSE(is_content_evil);
« no previous file with comments | « chrome/browser/prerender/prerender_browsertest.cc ('k') | chrome/browser/ui/find_bar/find_bar_host_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698