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

Side by Side Diff: chrome/browser/ui/views/toolbar/component_toolbar_actions_browsertest.cc

Issue 673503002: Rename BrowserActionView to ToolbarActionView (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/macros.h" 5 #include "base/macros.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "chrome/browser/ui/browser.h" 8 #include "chrome/browser/ui/browser.h"
9 #include "chrome/browser/ui/toolbar/component_toolbar_actions_factory.h" 9 #include "chrome/browser/ui/toolbar/component_toolbar_actions_factory.h"
10 #include "chrome/browser/ui/toolbar/toolbar_action_view_controller.h" 10 #include "chrome/browser/ui/toolbar/toolbar_action_view_controller.h"
11 #include "chrome/browser/ui/views/frame/browser_view.h" 11 #include "chrome/browser/ui/views/frame/browser_view.h"
12 #include "chrome/browser/ui/views/toolbar/browser_action_view.h"
13 #include "chrome/browser/ui/views/toolbar/browser_actions_container.h" 12 #include "chrome/browser/ui/views/toolbar/browser_actions_container.h"
13 #include "chrome/browser/ui/views/toolbar/toolbar_action_view.h"
14 #include "chrome/browser/ui/views/toolbar/toolbar_view.h" 14 #include "chrome/browser/ui/views/toolbar/toolbar_view.h"
15 #include "chrome/test/base/in_process_browser_test.h" 15 #include "chrome/test/base/in_process_browser_test.h"
16 #include "extensions/common/feature_switch.h" 16 #include "extensions/common/feature_switch.h"
17 #include "grit/theme_resources.h" 17 #include "grit/theme_resources.h"
18 #include "ui/base/resource/resource_bundle.h" 18 #include "ui/base/resource/resource_bundle.h"
19 19
20 namespace { 20 namespace {
21 21
22 const char kMockId[] = "mock_action"; 22 const char kMockId[] = "mock_action";
23 23
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 120
121 // Test that Component Toolbar Actions appear in the browser actions container 121 // Test that Component Toolbar Actions appear in the browser actions container
122 // and can receive click events properly. 122 // and can receive click events properly.
123 IN_PROC_BROWSER_TEST_F(ComponentToolbarActionsBrowserTest, 123 IN_PROC_BROWSER_TEST_F(ComponentToolbarActionsBrowserTest,
124 ComponentToolbarActionsShowUpAndRespondToClicks) { 124 ComponentToolbarActionsShowUpAndRespondToClicks) {
125 BrowserActionsContainer* browser_actions_container = 125 BrowserActionsContainer* browser_actions_container =
126 BrowserView::GetBrowserViewForBrowser(browser()) 126 BrowserView::GetBrowserViewForBrowser(browser())
127 ->toolbar()->browser_actions(); 127 ->toolbar()->browser_actions();
128 128
129 // There should be only one component action view. 129 // There should be only one component action view.
130 ASSERT_EQ(1u, browser_actions_container->num_browser_actions()); 130 ASSERT_EQ(1u, browser_actions_container->num_toolbar_actions());
131 131
132 BrowserActionView* view = 132 ToolbarActionView* view =
133 browser_actions_container->GetBrowserActionViewAt(0u); 133 browser_actions_container->GetToolbarActionViewAt(0u);
134 ASSERT_EQ(kMockId, view->view_controller()->GetId()); 134 ASSERT_EQ(kMockId, view->view_controller()->GetId());
135 MockComponentAction* mock_component_action = 135 MockComponentAction* mock_component_action =
136 static_cast<MockComponentAction*>(view->view_controller()); 136 static_cast<MockComponentAction*>(view->view_controller());
137 137
138 // Test that clicking on the component action works. 138 // Test that clicking on the component action works.
139 EXPECT_EQ(0u, mock_component_action->click_count()); 139 EXPECT_EQ(0u, mock_component_action->click_count());
140 view->Activate(); 140 view->Activate();
141 EXPECT_EQ(1u, mock_component_action->click_count()); 141 EXPECT_EQ(1u, mock_component_action->click_count());
142 } 142 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/toolbar/chevron_menu_button.cc ('k') | chrome/browser/ui/views/toolbar/toolbar_action_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698