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

Side by Side Diff: chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_unittest.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/ash/launcher/chrome_launcher_controller_impl.h" 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <map> 10 #include <map>
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 DISALLOW_COPY_AND_ASSIGN(ProxyShelfDelegate); 320 DISALLOW_COPY_AND_ASSIGN(ProxyShelfDelegate);
321 }; 321 };
322 322
323 // A callback that does nothing after shelf item selection handling. 323 // A callback that does nothing after shelf item selection handling.
324 void NoopCallback(ash::ShelfAction action, base::Optional<MenuItemList>) {} 324 void NoopCallback(ash::ShelfAction action, base::Optional<MenuItemList>) {}
325 325
326 // Simulates selection of the shelf item. 326 // Simulates selection of the shelf item.
327 void SelectItem(ash::mojom::ShelfItemDelegate* delegate) { 327 void SelectItem(ash::mojom::ShelfItemDelegate* delegate) {
328 std::unique_ptr<ui::Event> event = base::MakeUnique<ui::MouseEvent>( 328 std::unique_ptr<ui::Event> event = base::MakeUnique<ui::MouseEvent>(
329 ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(), ui::EventTimeForNow(), 329 ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(), ui::EventTimeForNow(),
330 ui::EF_NONE, 0); 330 ui::EF_NONE, 0,
331 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE));
331 delegate->ItemSelected(std::move(event), display::kInvalidDisplayId, 332 delegate->ItemSelected(std::move(event), display::kInvalidDisplayId,
332 ash::LAUNCH_FROM_UNKNOWN, base::Bind(&NoopCallback)); 333 ash::LAUNCH_FROM_UNKNOWN, base::Bind(&NoopCallback));
333 } 334 }
334 335
335 } // namespace 336 } // namespace
336 337
337 class ChromeLauncherControllerImplTest : public BrowserWithTestWindowTest { 338 class ChromeLauncherControllerImplTest : public BrowserWithTestWindowTest {
338 protected: 339 protected:
339 ChromeLauncherControllerImplTest() 340 ChromeLauncherControllerImplTest()
340 : BrowserWithTestWindowTest(Browser::TYPE_TABBED, false) {} 341 : BrowserWithTestWindowTest(Browser::TYPE_TABBED, false) {}
(...skipping 4079 matching lines...) Expand 10 before | Expand all | Expand 10 after
4420 EXPECT_EQ(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, 4421 EXPECT_EQ(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS,
4421 shelf_controller->auto_hide()); 4422 shelf_controller->auto_hide());
4422 EXPECT_EQ(2u, shelf_controller->auto_hide_change_count()); 4423 EXPECT_EQ(2u, shelf_controller->auto_hide_change_count());
4423 4424
4424 PrefService* prefs = profile()->GetTestingPrefService(); 4425 PrefService* prefs = profile()->GetTestingPrefService();
4425 EXPECT_EQ("Left", prefs->GetString(prefs::kShelfAlignmentLocal)); 4426 EXPECT_EQ("Left", prefs->GetString(prefs::kShelfAlignmentLocal));
4426 EXPECT_EQ("Left", prefs->GetString(prefs::kShelfAlignment)); 4427 EXPECT_EQ("Left", prefs->GetString(prefs::kShelfAlignment));
4427 EXPECT_EQ("Always", prefs->GetString(prefs::kShelfAutoHideBehaviorLocal)); 4428 EXPECT_EQ("Always", prefs->GetString(prefs::kShelfAutoHideBehaviorLocal));
4428 EXPECT_EQ("Always", prefs->GetString(prefs::kShelfAutoHideBehavior)); 4429 EXPECT_EQ("Always", prefs->GetString(prefs::kShelfAutoHideBehavior));
4429 } 4430 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698