| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/browser/ui/webui/options2/options_ui2_browsertest.h" | |
| 6 | |
| 7 #include "base/string16.h" | |
| 8 #include "base/utf_string_conversions.h" | |
| 9 #include "chrome/browser/ui/browser.h" | |
| 10 #include "chrome/browser/ui/browser_tabstrip.h" | |
| 11 #include "chrome/common/url_constants.h" | |
| 12 #include "chrome/test/base/ui_test_utils.h" | |
| 13 #include "content/public/browser/web_contents.h" | |
| 14 #include "grit/generated_resources.h" | |
| 15 #include "ui/base/l10n/l10n_util.h" | |
| 16 | |
| 17 namespace options2 { | |
| 18 | |
| 19 OptionsBrowserTest::OptionsBrowserTest() { | |
| 20 EnableDOMAutomation(); | |
| 21 } | |
| 22 | |
| 23 void OptionsBrowserTest::NavigateToSettings() { | |
| 24 const GURL& url = GURL(chrome::kChromeUISettingsURL); | |
| 25 ui_test_utils::NavigateToURL(browser(), url); | |
| 26 } | |
| 27 | |
| 28 void OptionsBrowserTest::VerifyNavbar() { | |
| 29 bool navbar_exist = false; | |
| 30 EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( | |
| 31 chrome::GetActiveWebContents(browser())->GetRenderViewHost(), | |
| 32 L"", | |
| 33 L"domAutomationController.send(" | |
| 34 L"!!document.getElementById('navigation'))", &navbar_exist)); | |
| 35 EXPECT_EQ(true, navbar_exist); | |
| 36 } | |
| 37 | |
| 38 void OptionsBrowserTest::VerifyTitle() { | |
| 39 string16 title = chrome::GetActiveWebContents(browser())->GetTitle(); | |
| 40 string16 expected_title = l10n_util::GetStringUTF16(IDS_SETTINGS_TITLE); | |
| 41 EXPECT_NE(title.find(expected_title), string16::npos); | |
| 42 } | |
| 43 | |
| 44 // Flaky, see http://crbug.com/119671. | |
| 45 IN_PROC_BROWSER_TEST_F(OptionsBrowserTest, FLAKY_LoadOptionsByURL) { | |
| 46 NavigateToSettings(); | |
| 47 VerifyTitle(); | |
| 48 VerifyNavbar(); | |
| 49 } | |
| 50 | |
| 51 } // namespace options2 | |
| OLD | NEW |