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

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

Issue 1573843002: Make `chrome` target build without unused data members on Linux. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@content_target
Patch Set: browsertest fix Created 4 years, 11 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/run_loop.h" 6 #include "base/run_loop.h"
7 #include "base/strings/string16.h" 7 #include "base/strings/string16.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/sessions/session_tab_helper.h" 9 #include "chrome/browser/sessions/session_tab_helper.h"
10 #include "chrome/browser/ui/toolbar/test_toolbar_action_view_controller.h" 10 #include "chrome/browser/ui/toolbar/test_toolbar_action_view_controller.h"
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 content::WebContents* web_contents = 148 content::WebContents* web_contents =
149 web_contents_factory.CreateWebContents(&profile); 149 web_contents_factory.CreateWebContents(&profile);
150 SessionTabHelper::CreateForWebContents(web_contents); 150 SessionTabHelper::CreateForWebContents(web_contents);
151 action_view_delegate.set_web_contents(web_contents); 151 action_view_delegate.set_web_contents(web_contents);
152 152
153 // Move the mouse off the not-yet-existent button. 153 // Move the mouse off the not-yet-existent button.
154 ui::test::EventGenerator generator(GetContext(), widget()->GetNativeWindow()); 154 ui::test::EventGenerator generator(GetContext(), widget()->GetNativeWindow());
155 generator.MoveMouseTo(gfx::Point(300, 300)); 155 generator.MoveMouseTo(gfx::Point(300, 300));
156 156
157 // Create a new toolbar action view. 157 // Create a new toolbar action view.
158 ToolbarActionView view(&controller, &profile, &action_view_delegate); 158 ToolbarActionView view(&controller, &action_view_delegate);
159 view.set_owned_by_client(); 159 view.set_owned_by_client();
160 view.SetBoundsRect(gfx::Rect(0, 0, 200, 20)); 160 view.SetBoundsRect(gfx::Rect(0, 0, 200, 20));
161 widget()->SetContentsView(&view); 161 widget()->SetContentsView(&view);
162 widget()->Show(); 162 widget()->Show();
163 163
164 // Check that the tooltip and accessible state of the view match the 164 // Check that the tooltip and accessible state of the view match the
165 // controller's. 165 // controller's.
166 base::string16 tooltip_test; 166 base::string16 tooltip_test;
167 EXPECT_TRUE(view.GetTooltipText(gfx::Point(), &tooltip_test)); 167 EXPECT_TRUE(view.GetTooltipText(gfx::Point(), &tooltip_test));
168 EXPECT_EQ(tooltip, tooltip_test); 168 EXPECT_EQ(tooltip, tooltip_test);
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 // If the view isn't visible, the overflow button should be pressed for 225 // If the view isn't visible, the overflow button should be pressed for
226 // popups. 226 // popups.
227 view.SetVisible(false); 227 view.SetVisible(false);
228 controller.ShowPopup(true); 228 controller.ShowPopup(true);
229 EXPECT_EQ(views::Button::STATE_NORMAL, view.state()); 229 EXPECT_EQ(views::Button::STATE_NORMAL, view.state());
230 EXPECT_EQ(views::Button::STATE_PRESSED, overflow_button.state()); 230 EXPECT_EQ(views::Button::STATE_PRESSED, overflow_button.state());
231 controller.HidePopup(); 231 controller.HidePopup();
232 EXPECT_EQ(views::Button::STATE_NORMAL, view.state()); 232 EXPECT_EQ(views::Button::STATE_NORMAL, view.state());
233 EXPECT_EQ(views::Button::STATE_NORMAL, overflow_button.state()); 233 EXPECT_EQ(views::Button::STATE_NORMAL, overflow_button.state());
234 } 234 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/toolbar/toolbar_action_view.cc ('k') | components/gcm_driver/instance_id/instance_id_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698