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

Side by Side Diff: chrome/browser/ui/views/profiles/profile_chooser_view_browsertest.cc

Issue 2786693002: Add PointerDetails to ui::MouseEvent's constructors (Closed)
Patch Set: mouse event constructor Created 3 years, 8 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 "chrome/browser/ui/views/profiles/profile_chooser_view.h" 5 #include "chrome/browser/ui/views/profiles/profile_chooser_view.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 } 128 }
129 129
130 void OpenProfileChooserView(Browser* browser) { 130 void OpenProfileChooserView(Browser* browser) {
131 BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser); 131 BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser);
132 views::View* button = browser_view->frame()->GetNewAvatarMenuButton(); 132 views::View* button = browser_view->frame()->GetNewAvatarMenuButton();
133 if (!button) 133 if (!button)
134 NOTREACHED() << "NewAvatarButton not found."; 134 NOTREACHED() << "NewAvatarButton not found.";
135 135
136 ProfileChooserView::close_on_deactivate_for_testing_ = false; 136 ProfileChooserView::close_on_deactivate_for_testing_ = false;
137 137
138 ui::MouseEvent e(ui::ET_MOUSE_RELEASED, gfx::Point(), gfx::Point(), 138 ui::MouseEvent e(
139 ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON, 0); 139 ui::ET_MOUSE_RELEASED, gfx::Point(), gfx::Point(),
140 ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON, 0,
141 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
140 button->OnMouseReleased(e); 142 button->OnMouseReleased(e);
141 base::RunLoop().RunUntilIdle(); 143 base::RunLoop().RunUntilIdle();
142 EXPECT_TRUE(ProfileChooserView::IsShowing()); 144 EXPECT_TRUE(ProfileChooserView::IsShowing());
143 145
144 // Create this observer before lock is pressed to avoid a race condition. 146 // Create this observer before lock is pressed to avoid a race condition.
145 window_close_observer_.reset(new content::WindowedNotificationObserver( 147 window_close_observer_.reset(new content::WindowedNotificationObserver(
146 chrome::NOTIFICATION_BROWSER_CLOSED, 148 chrome::NOTIFICATION_BROWSER_CLOSED,
147 content::Source<Browser>(browser))); 149 content::Source<Browser>(browser)));
148 } 150 }
149 151
150 AvatarMenu* GetProfileChooserViewAvatarMenu() { 152 AvatarMenu* GetProfileChooserViewAvatarMenu() {
151 return ProfileChooserView::profile_bubble_->avatar_menu_.get(); 153 return ProfileChooserView::profile_bubble_->avatar_menu_.get();
152 } 154 }
153 155
154 void ClickProfileChooserViewLockButton() { 156 void ClickProfileChooserViewLockButton() {
155 ui::MouseEvent e(ui::ET_MOUSE_RELEASED, gfx::Point(), gfx::Point(), 157 ui::MouseEvent e(
156 ui::EventTimeForNow(), 0, 0); 158 ui::ET_MOUSE_RELEASED, gfx::Point(), gfx::Point(),
159 ui::EventTimeForNow(), 0, 0,
160 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
157 ProfileChooserView::profile_bubble_->ButtonPressed( 161 ProfileChooserView::profile_bubble_->ButtonPressed(
158 ProfileChooserView::profile_bubble_->lock_button_, e); 162 ProfileChooserView::profile_bubble_->lock_button_, e);
159 } 163 }
160 164
161 // Access the registry that has been prepared with at least one extension. 165 // Access the registry that has been prepared with at least one extension.
162 extensions::ExtensionRegistry* GetPreparedRegistry(Profile* signed_in) { 166 extensions::ExtensionRegistry* GetPreparedRegistry(Profile* signed_in) {
163 extensions::ExtensionRegistry* registry = 167 extensions::ExtensionRegistry* registry =
164 extensions::ExtensionRegistry::Get(signed_in); 168 extensions::ExtensionRegistry::Get(signed_in);
165 const size_t initial_num_extensions = registry->enabled_extensions().size(); 169 const size_t initial_num_extensions = registry->enabled_extensions().size();
166 const extensions::Extension* ext = LoadExtension( 170 const extensions::Extension* ext = LoadExtension(
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 // Wait until the user manager is shown. 338 // Wait until the user manager is shown.
335 runner->Run(); 339 runner->Run();
336 340
337 // Assert that the first profile's extensions are not blocked. 341 // Assert that the first profile's extensions are not blocked.
338 ASSERT_EQ(total_enabled_extensions, registry->enabled_extensions().size()); 342 ASSERT_EQ(total_enabled_extensions, registry->enabled_extensions().size());
339 ASSERT_EQ(0U, registry->blocked_extensions().size()); 343 ASSERT_EQ(0U, registry->blocked_extensions().size());
340 344
341 // We need to hide the User Manager or else the process can't die. 345 // We need to hide the User Manager or else the process can't die.
342 UserManager::Hide(); 346 UserManager::Hide();
343 } 347 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698