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

Side by Side Diff: chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc

Issue 2867673004: Use OnceCallback on Mojo interfaces in //ash (Closed)
Patch Set: count -> container_count Created 3 years, 7 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.h" 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 public: 257 public:
258 explicit TestV2AppLauncherItemController(const std::string& app_id) 258 explicit TestV2AppLauncherItemController(const std::string& app_id)
259 : ash::ShelfItemDelegate(ash::ShelfID(app_id)) {} 259 : ash::ShelfItemDelegate(ash::ShelfID(app_id)) {}
260 260
261 ~TestV2AppLauncherItemController() override {} 261 ~TestV2AppLauncherItemController() override {}
262 262
263 // Override for ash::ShelfItemDelegate: 263 // Override for ash::ShelfItemDelegate:
264 void ItemSelected(std::unique_ptr<ui::Event> event, 264 void ItemSelected(std::unique_ptr<ui::Event> event,
265 int64_t display_id, 265 int64_t display_id,
266 ash::ShelfLaunchSource source, 266 ash::ShelfLaunchSource source,
267 const ItemSelectedCallback& callback) override { 267 ItemSelectedCallback callback) override {
268 callback.Run(ash::SHELF_ACTION_WINDOW_ACTIVATED, base::nullopt); 268 std::move(callback).Run(ash::SHELF_ACTION_WINDOW_ACTIVATED, base::nullopt);
269 } 269 }
270 void ExecuteCommand(uint32_t command_id, int32_t event_flags) override {} 270 void ExecuteCommand(uint32_t command_id, int32_t event_flags) override {}
271 void Close() override {} 271 void Close() override {}
272 272
273 private: 273 private:
274 DISALLOW_COPY_AND_ASSIGN(TestV2AppLauncherItemController); 274 DISALLOW_COPY_AND_ASSIGN(TestV2AppLauncherItemController);
275 }; 275 };
276 276
277 // A test ShelfController implementation that tracks alignment and auto-hide. 277 // A test ShelfController implementation that tracks alignment and auto-hide.
278 class TestShelfController : public ash::mojom::ShelfController { 278 class TestShelfController : public ash::mojom::ShelfController {
(...skipping 3937 matching lines...) Expand 10 before | Expand all | Expand 10 after
4216 EXPECT_EQ(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, 4216 EXPECT_EQ(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS,
4217 shelf_controller->auto_hide()); 4217 shelf_controller->auto_hide());
4218 EXPECT_EQ(2u, shelf_controller->auto_hide_change_count()); 4218 EXPECT_EQ(2u, shelf_controller->auto_hide_change_count());
4219 4219
4220 PrefService* prefs = profile()->GetTestingPrefService(); 4220 PrefService* prefs = profile()->GetTestingPrefService();
4221 EXPECT_EQ("Left", prefs->GetString(prefs::kShelfAlignmentLocal)); 4221 EXPECT_EQ("Left", prefs->GetString(prefs::kShelfAlignmentLocal));
4222 EXPECT_EQ("Left", prefs->GetString(prefs::kShelfAlignment)); 4222 EXPECT_EQ("Left", prefs->GetString(prefs::kShelfAlignment));
4223 EXPECT_EQ("Always", prefs->GetString(prefs::kShelfAutoHideBehaviorLocal)); 4223 EXPECT_EQ("Always", prefs->GetString(prefs::kShelfAutoHideBehaviorLocal));
4224 EXPECT_EQ("Always", prefs->GetString(prefs::kShelfAutoHideBehavior)); 4224 EXPECT_EQ("Always", prefs->GetString(prefs::kShelfAutoHideBehavior));
4225 } 4225 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698