OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/webui/options/options_ui_browsertest.h" | 5 #include "chrome/browser/ui/webui/options/options_ui_browsertest.h" |
6 | 6 |
7 #include "base/string16.h" | 7 #include "base/string16.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
10 #include "chrome/browser/ui/browser_tabstrip.h" | 10 #include "chrome/browser/ui/browser_tabstrip.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 | 22 |
23 void OptionsBrowserTest::NavigateToSettings() { | 23 void OptionsBrowserTest::NavigateToSettings() { |
24 const GURL& url = GURL(chrome::kChromeUISettingsURL); | 24 const GURL& url = GURL(chrome::kChromeUISettingsURL); |
25 ui_test_utils::NavigateToURL(browser(), url); | 25 ui_test_utils::NavigateToURL(browser(), url); |
26 } | 26 } |
27 | 27 |
28 void OptionsBrowserTest::VerifyNavbar() { | 28 void OptionsBrowserTest::VerifyNavbar() { |
29 bool navbar_exist = false; | 29 bool navbar_exist = false; |
30 EXPECT_TRUE(content::ExecuteJavaScriptAndExtractBool( | 30 EXPECT_TRUE(content::ExecuteJavaScriptAndExtractBool( |
31 chrome::GetActiveWebContents(browser())->GetRenderViewHost(), | 31 chrome::GetActiveWebContents(browser())->GetRenderViewHost(), |
32 "", | 32 L"", |
33 "domAutomationController.send(" | 33 L"domAutomationController.send(" |
34 " !!document.getElementById('navigation'))", | 34 L"!!document.getElementById('navigation'))", &navbar_exist)); |
35 &navbar_exist)); | |
36 EXPECT_EQ(true, navbar_exist); | 35 EXPECT_EQ(true, navbar_exist); |
37 } | 36 } |
38 | 37 |
39 void OptionsBrowserTest::VerifyTitle() { | 38 void OptionsBrowserTest::VerifyTitle() { |
40 string16 title = chrome::GetActiveWebContents(browser())->GetTitle(); | 39 string16 title = chrome::GetActiveWebContents(browser())->GetTitle(); |
41 string16 expected_title = l10n_util::GetStringUTF16(IDS_SETTINGS_TITLE); | 40 string16 expected_title = l10n_util::GetStringUTF16(IDS_SETTINGS_TITLE); |
42 EXPECT_NE(title.find(expected_title), string16::npos); | 41 EXPECT_NE(title.find(expected_title), string16::npos); |
43 } | 42 } |
44 | 43 |
45 // Flaky, see http://crbug.com/119671. | 44 // Flaky, see http://crbug.com/119671. |
46 IN_PROC_BROWSER_TEST_F(OptionsBrowserTest, DISABLED_LoadOptionsByURL) { | 45 IN_PROC_BROWSER_TEST_F(OptionsBrowserTest, DISABLED_LoadOptionsByURL) { |
47 NavigateToSettings(); | 46 NavigateToSettings(); |
48 VerifyTitle(); | 47 VerifyTitle(); |
49 VerifyNavbar(); | 48 VerifyNavbar(); |
50 } | 49 } |
51 | 50 |
52 } // namespace options | 51 } // namespace options |
OLD | NEW |