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

Side by Side Diff: chrome/browser/dom_ui/options_ui_uitest.cc

Issue 3015035: Make product name dynamic in DOMUI pref unit tests (Closed)
Patch Set: Created 10 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "app/l10n_util.h"
5 #include "base/command_line.h" 6 #include "base/command_line.h"
6 #include "chrome/app/chrome_dll_resource.h" 7 #include "chrome/app/chrome_dll_resource.h"
7 #include "chrome/common/chrome_switches.h" 8 #include "chrome/common/chrome_switches.h"
8 #include "chrome/common/url_constants.h" 9 #include "chrome/common/url_constants.h"
9 #include "chrome/test/automation/browser_proxy.h" 10 #include "chrome/test/automation/browser_proxy.h"
10 #include "chrome/test/automation/tab_proxy.h" 11 #include "chrome/test/automation/tab_proxy.h"
11 #include "chrome/test/automation/window_proxy.h" 12 #include "chrome/test/automation/window_proxy.h"
12 #include "chrome/test/ui/ui_test.h" 13 #include "chrome/test/ui/ui_test.h"
13 14
15 #include "grit/chromium_strings.h"
16 #include "grit/generated_resources.h"
17
14 namespace { 18 namespace {
15 19
16 class OptionsUITest : public UITest { 20 class OptionsUITest : public UITest {
17 public: 21 public:
18 OptionsUITest() { 22 OptionsUITest() {
19 dom_automation_enabled_ = true; 23 dom_automation_enabled_ = true;
20 // TODO(csilv): Remove when dom-ui options is enabled by default. 24 // TODO(csilv): Remove when dom-ui options is enabled by default.
21 launch_arguments_.AppendSwitch(switches::kEnableTabbedOptions); 25 launch_arguments_.AppendSwitch(switches::kEnableTabbedOptions);
22 } 26 }
23 27
24 void AssertIsOptionsPage(TabProxy* tab) { 28 void AssertIsOptionsPage(TabProxy* tab) {
25 std::wstring title; 29 std::wstring title;
26 ASSERT_TRUE(tab->GetTabTitle(&title)); 30 ASSERT_TRUE(tab->GetTabTitle(&title));
27 ASSERT_EQ(L"Chromium Options", title); 31 std::wstring expected_title =
32 l10n_util::GetStringF(IDS_OPTIONS_DIALOG_TITLE,
33 l10n_util::GetString(IDS_PRODUCT_NAME));
34 ASSERT_EQ(expected_title, title);
28 } 35 }
29 }; 36 };
30 37
31 TEST_F(OptionsUITest, LoadOptionsByURL) { 38 TEST_F(OptionsUITest, LoadOptionsByURL) {
32 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); 39 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0));
33 ASSERT_TRUE(browser.get()); 40 ASSERT_TRUE(browser.get());
34 41
35 scoped_refptr<TabProxy> tab = browser->GetActiveTab(); 42 scoped_refptr<TabProxy> tab = browser->GetActiveTab();
36 ASSERT_TRUE(tab.get()); 43 ASSERT_TRUE(tab.get());
37 44
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 ASSERT_TRUE(browser->GetTabCount(&tab_count)); 104 ASSERT_TRUE(browser->GetTabCount(&tab_count));
98 ASSERT_EQ(1, tab_count); 105 ASSERT_EQ(1, tab_count);
99 106
100 ASSERT_TRUE(browser->RunCommand(IDC_OPTIONS)); 107 ASSERT_TRUE(browser->RunCommand(IDC_OPTIONS));
101 ASSERT_TRUE(browser->RunCommandAsync(IDC_OPTIONS)); 108 ASSERT_TRUE(browser->RunCommandAsync(IDC_OPTIONS));
102 ASSERT_TRUE(browser->GetTabCount(&tab_count)); 109 ASSERT_TRUE(browser->GetTabCount(&tab_count));
103 ASSERT_EQ(2, tab_count); 110 ASSERT_EQ(2, tab_count);
104 } 111 }
105 112
106 } // namespace 113 } // namespace
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698