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

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

Issue 653933003: Resubmit: Rename BrowserActionView to ToolbarActionView (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 119
120 // Test that Component Toolbar Actions appear in the browser actions container 120 // Test that Component Toolbar Actions appear in the browser actions container
121 // and can receive click events properly. 121 // and can receive click events properly.
122 IN_PROC_BROWSER_TEST_F(ComponentToolbarActionsBrowserTest, 122 IN_PROC_BROWSER_TEST_F(ComponentToolbarActionsBrowserTest,
123 ComponentToolbarActionsShowUpAndRespondToClicks) { 123 ComponentToolbarActionsShowUpAndRespondToClicks) {
124 BrowserActionsContainer* browser_actions_container = 124 BrowserActionsContainer* browser_actions_container =
125 BrowserView::GetBrowserViewForBrowser(browser()) 125 BrowserView::GetBrowserViewForBrowser(browser())
126 ->toolbar()->browser_actions(); 126 ->toolbar()->browser_actions();
127 127
128 // There should be only one component action view. 128 // There should be only one component action view.
129 ASSERT_EQ(1u, browser_actions_container->num_browser_actions()); 129 ASSERT_EQ(1u, browser_actions_container->num_toolbar_actions());
130 130
131 BrowserActionView* view = 131 ToolbarActionView* view =
132 browser_actions_container->GetBrowserActionViewAt(0u); 132 browser_actions_container->GetToolbarActionViewAt(0u);
133 ASSERT_EQ(kMockId, view->view_controller()->GetId()); 133 ASSERT_EQ(kMockId, view->view_controller()->GetId());
134 MockComponentAction* mock_component_action = 134 MockComponentAction* mock_component_action =
135 static_cast<MockComponentAction*>(view->view_controller()); 135 static_cast<MockComponentAction*>(view->view_controller());
136 136
137 // Test that clicking on the component action works. 137 // Test that clicking on the component action works.
138 EXPECT_EQ(0u, mock_component_action->click_count()); 138 EXPECT_EQ(0u, mock_component_action->click_count());
139 view->Activate(); 139 view->Activate();
140 EXPECT_EQ(1u, mock_component_action->click_count()); 140 EXPECT_EQ(1u, mock_component_action->click_count());
141 } 141 }
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