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

Unified Diff: ash/shelf/shelf_view_unittest.cc

Issue 2696073002: Merge ShelfItemDelegate::ItemSelected & LauncherItemDelegate::Activate. (Closed)
Patch Set: nit Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/public/cpp/shelf_types.h ('k') | ash/shell/window_watcher_shelf_item_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf_view_unittest.cc
diff --git a/ash/shelf/shelf_view_unittest.cc b/ash/shelf/shelf_view_unittest.cc
index 04aff136026446704bdceb6ef40e3a9b7771fe1a..d3508e07dd1cf6085a1adccc07ef0ea10daeb81a 100644
--- a/ash/shelf/shelf_view_unittest.cc
+++ b/ash/shelf/shelf_view_unittest.cc
@@ -141,15 +141,14 @@ class ShelfItemSelectionTracker : public TestShelfItemDelegate {
ShelfItemSelectionTracker()
: TestShelfItemDelegate(NULL),
selected_(false),
- item_selected_action_(kNoAction) {}
+ item_selected_action_(SHELF_ACTION_NONE) {}
~ShelfItemSelectionTracker() override {}
// Resets to the initial state.
void Reset() { selected_ = false; }
- void set_item_selected_action(
- ShelfItemDelegate::PerformedAction item_selected_action) {
+ void set_item_selected_action(ShelfAction item_selected_action) {
item_selected_action_ = item_selected_action;
}
@@ -157,8 +156,10 @@ class ShelfItemSelectionTracker : public TestShelfItemDelegate {
bool WasSelected() { return selected_; }
// TestShelfItemDelegate:
- ShelfItemDelegate::PerformedAction ItemSelected(
- const ui::Event& event) override {
+ ShelfAction ItemSelected(ui::EventType event_type,
+ int event_flags,
+ int64_t display_id,
+ ShelfLaunchSource source) override {
selected_ = true;
return item_selected_action_;
}
@@ -167,7 +168,7 @@ class ShelfItemSelectionTracker : public TestShelfItemDelegate {
bool selected_;
// The action returned from ItemSelected(const ui::Event&).
- ShelfItemDelegate::PerformedAction item_selected_action_;
+ ShelfAction item_selected_action_;
DISALLOW_COPY_AND_ASSIGN(ShelfItemSelectionTracker);
};
@@ -1828,8 +1829,7 @@ TEST_F(ShelfViewTest, Launcher_TaskUserActionsRecordedWhenItemSelected) {
ShelfID browser_shelf_id = model_->items()[browser_index_].id;
ShelfItemSelectionTracker* selection_tracker = new ShelfItemSelectionTracker;
- selection_tracker->set_item_selected_action(
- ShelfItemDelegate::kNewWindowCreated);
+ selection_tracker->set_item_selected_action(SHELF_ACTION_NEW_WINDOW_CREATED);
model_->SetShelfItemDelegate(
browser_shelf_id, std::unique_ptr<ShelfItemDelegate>(selection_tracker));
@@ -1848,12 +1848,10 @@ TEST_F(ShelfViewTest,
model_->SetShelfItemDelegate(
browser_shelf_id, std::unique_ptr<ShelfItemDelegate>(selection_tracker));
- selection_tracker->set_item_selected_action(
- ShelfItemDelegate::kExistingWindowMinimized);
+ selection_tracker->set_item_selected_action(SHELF_ACTION_WINDOW_MINIMIZED);
SimulateClick(browser_index_);
- selection_tracker->set_item_selected_action(
- ShelfItemDelegate::kExistingWindowActivated);
+ selection_tracker->set_item_selected_action(SHELF_ACTION_WINDOW_ACTIVATED);
SimulateClick(browser_index_);
histogram_tester.ExpectTotalCount(
« no previous file with comments | « ash/public/cpp/shelf_types.h ('k') | ash/shell/window_watcher_shelf_item_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698