summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-16 23:58:21 +0000
committermpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-16 23:58:21 +0000
commit77bd2cefb7f0f8f437b47b3d6a3dd458b8d4fe2e (patch)
tree6ab51a1172ffd9ffdafec2112603fd3587eb6576
parent993c8285020caa6081f481f921f70d9035b24f3d (diff)
downloadchromium_src-77bd2cefb7f0f8f437b47b3d6a3dd458b8d4fe2e.zip
chromium_src-77bd2cefb7f0f8f437b47b3d6a3dd458b8d4fe2e.tar.gz
chromium_src-77bd2cefb7f0f8f437b47b3d6a3dd458b8d4fe2e.tar.bz2
Fix flaky ExtensionBrowserTest.IncognitoYesScript.
BUG=35885 Review URL: http://codereview.chromium.org/611002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39163 0039d316-1c4b-4281-b951-d872f2087c98
-rwxr-xr-xchrome/browser/extensions/incognito_noscript_apitest.cc25
1 files changed, 17 insertions, 8 deletions
diff --git a/chrome/browser/extensions/incognito_noscript_apitest.cc b/chrome/browser/extensions/incognito_noscript_apitest.cc
index fc08c0d..d4e71a5 100755
--- a/chrome/browser/extensions/incognito_noscript_apitest.cc
+++ b/chrome/browser/extensions/incognito_noscript_apitest.cc
@@ -31,14 +31,18 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, IncognitoNoScript) {
GURL("http://www.example.com:1337/files/extensions/test_file.html"));
Browser* otr_browser = BrowserList::FindBrowserWithType(
browser()->profile()->GetOffTheRecordProfile(), Browser::TYPE_NORMAL);
+ TabContents* tab = otr_browser->GetSelectedTabContents();
- string16 title;
- ui_test_utils::GetCurrentTabTitle(otr_browser, &title);
- ASSERT_EQ("Unmodified", UTF16ToASCII(title));
+ // Verify the script didn't run.
+ bool result = false;
+ ui_test_utils::ExecuteJavaScriptAndExtractBool(
+ tab->render_view_host(), L"",
+ L"window.domAutomationController.send(document.title == 'Unmodified')",
+ &result);
+ EXPECT_TRUE(result);
}
-// Flaky, see: http://crbug.com/35885.
-IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, FLAKY_IncognitoYesScript) {
+IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, IncognitoYesScript) {
host_resolver()->AddRule("*", "127.0.0.1");
StartHTTPServer();
@@ -72,8 +76,13 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, FLAKY_IncognitoYesScript) {
GURL("http://www.example.com:1337/files/extensions/test_file.html"));
Browser* otr_browser = BrowserList::FindBrowserWithType(
browser()->profile()->GetOffTheRecordProfile(), Browser::TYPE_NORMAL);
+ TabContents* tab = otr_browser->GetSelectedTabContents();
- string16 title;
- ui_test_utils::GetCurrentTabTitle(otr_browser, &title);
- ASSERT_EQ("modified", UTF16ToASCII(title));
+ // Verify the script ran.
+ bool result = false;
+ ui_test_utils::ExecuteJavaScriptAndExtractBool(
+ tab->render_view_host(), L"",
+ L"window.domAutomationController.send(document.title == 'modified')",
+ &result);
+ EXPECT_TRUE(result);
}