OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/string16.h" | 6 #include "base/string16.h" |
7 #include "base/test/test_timeouts.h" | 7 #include "base/test/test_timeouts.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
10 #include "chrome/common/chrome_switches.h" | 10 #include "chrome/common/chrome_switches.h" |
11 #include "chrome/common/url_constants.h" | 11 #include "chrome/common/url_constants.h" |
12 #include "chrome/test/automation/browser_proxy.h" | 12 #include "chrome/test/automation/browser_proxy.h" |
13 #include "chrome/test/automation/tab_proxy.h" | 13 #include "chrome/test/automation/tab_proxy.h" |
14 #include "chrome/test/automation/window_proxy.h" | 14 #include "chrome/test/automation/window_proxy.h" |
15 #include "chrome/test/ui/ui_test.h" | 15 #include "chrome/test/ui/ui_test.h" |
16 #include "grit/chromium_strings.h" | 16 #include "grit/chromium_strings.h" |
17 #include "grit/generated_resources.h" | 17 #include "grit/generated_resources.h" |
18 #include "ui/base/l10n/l10n_util.h" | 18 #include "ui/base/l10n/l10n_util.h" |
19 | 19 |
20 namespace { | 20 namespace { |
21 | 21 |
22 class OptionsUITest : public UITest { | 22 class OptionsUITest : public UITest { |
23 public: | 23 public: |
24 OptionsUITest() { | 24 OptionsUITest() { |
25 dom_automation_enabled_ = true; | 25 dom_automation_enabled_ = true; |
26 } | 26 } |
27 | 27 |
28 void AssertIsOptionsPage(TabProxy* tab) { | 28 void AssertIsOptionsPage(TabProxy* tab) { |
29 std::wstring title; | 29 string16 title; |
30 ASSERT_TRUE(tab->GetTabTitle(&title)); | 30 ASSERT_TRUE(tab->GetTabTitle(&title)); |
31 string16 expected_title = l10n_util::GetStringUTF16(IDS_SETTINGS_TITLE); | 31 string16 expected_title = l10n_util::GetStringUTF16(IDS_SETTINGS_TITLE); |
32 ASSERT_EQ(expected_title, WideToUTF16Hack(title)); | 32 ASSERT_EQ(expected_title, title); |
33 } | 33 } |
34 }; | 34 }; |
35 | 35 |
36 TEST_F(OptionsUITest, LoadOptionsByURL) { | 36 TEST_F(OptionsUITest, LoadOptionsByURL) { |
37 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); | 37 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); |
38 ASSERT_TRUE(browser.get()); | 38 ASSERT_TRUE(browser.get()); |
39 | 39 |
40 scoped_refptr<TabProxy> tab = browser->GetActiveTab(); | 40 scoped_refptr<TabProxy> tab = browser->GetActiveTab(); |
41 ASSERT_TRUE(tab.get()); | 41 ASSERT_TRUE(tab.get()); |
42 | 42 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 ASSERT_TRUE(browser->GetTabCount(&tab_count)); | 119 ASSERT_TRUE(browser->GetTabCount(&tab_count)); |
120 ASSERT_EQ(1, tab_count); | 120 ASSERT_EQ(1, tab_count); |
121 | 121 |
122 ASSERT_TRUE(browser->RunCommand(IDC_OPTIONS)); | 122 ASSERT_TRUE(browser->RunCommand(IDC_OPTIONS)); |
123 ASSERT_TRUE(browser->RunCommand(IDC_OPTIONS)); | 123 ASSERT_TRUE(browser->RunCommand(IDC_OPTIONS)); |
124 ASSERT_TRUE(browser->GetTabCount(&tab_count)); | 124 ASSERT_TRUE(browser->GetTabCount(&tab_count)); |
125 ASSERT_EQ(2, tab_count); | 125 ASSERT_EQ(2, tab_count); |
126 } | 126 } |
127 | 127 |
128 } // namespace | 128 } // namespace |
OLD | NEW |