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

Side by Side Diff: ash/common/system/chromeos/palette/palette_tool_manager_unittest.cc

Issue 2308823002: Add UMA stats for pen palette (Closed)
Patch Set: rebase Created 4 years, 3 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "ash/common/system/chromeos/palette/palette_tool.h" 5 #include "ash/common/system/chromeos/palette/palette_tool.h"
6 #include "ash/common/system/chromeos/palette/palette_tool_manager.h" 6 #include "ash/common/system/chromeos/palette/palette_tool_manager.h"
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 ~PaletteToolManagerTest() override {} 51 ~PaletteToolManagerTest() override {}
52 52
53 protected: 53 protected:
54 // PaletteToolManager::Delegate: 54 // PaletteToolManager::Delegate:
55 void HidePalette() override {} 55 void HidePalette() override {}
56 void OnActiveToolChanged() override { ++tool_changed_count_; } 56 void OnActiveToolChanged() override { ++tool_changed_count_; }
57 WmWindow* GetWindow() override { 57 WmWindow* GetWindow() override {
58 NOTREACHED(); 58 NOTREACHED();
59 return nullptr; 59 return nullptr;
60 } 60 }
61 void RecordPaletteOptionsUsage(PaletteTrayOptions option) override {}
62 void RecordPaletteModeCancellation(PaletteModeCancelType type) override {}
61 63
62 // PaletteTool::Delegate: 64 // PaletteTool::Delegate:
63 void EnableTool(PaletteToolId tool_id) override {} 65 void EnableTool(PaletteToolId tool_id) override {}
64 void DisableTool(PaletteToolId tool_id) override {} 66 void DisableTool(PaletteToolId tool_id) override {}
65 67
66 // Helper method for returning an unowned pointer to the constructed tool 68 // Helper method for returning an unowned pointer to the constructed tool
67 // while also adding it to the PaletteToolManager. 69 // while also adding it to the PaletteToolManager.
68 TestTool* BuildTool(PaletteGroup group, PaletteToolId tool_id) { 70 TestTool* BuildTool(PaletteGroup group, PaletteToolId tool_id) {
69 auto* tool = new TestTool(this, group, tool_id); 71 auto* tool = new TestTool(this, group, tool_id);
70 palette_tool_manager_->AddTool(base::WrapUnique(tool)); 72 palette_tool_manager_->AddTool(base::WrapUnique(tool));
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 127
126 // Activating an already active tool will not do anything. 128 // Activating an already active tool will not do anything.
127 palette_tool_manager_->ActivateTool(action_1->GetToolId()); 129 palette_tool_manager_->ActivateTool(action_1->GetToolId());
128 EXPECT_TRUE(action_1->enabled()); 130 EXPECT_TRUE(action_1->enabled());
129 EXPECT_FALSE(action_2->enabled()); 131 EXPECT_FALSE(action_2->enabled());
130 palette_tool_manager_->ActivateTool(action_1->GetToolId()); 132 palette_tool_manager_->ActivateTool(action_1->GetToolId());
131 EXPECT_TRUE(action_1->enabled()); 133 EXPECT_TRUE(action_1->enabled());
132 EXPECT_FALSE(action_2->enabled()); 134 EXPECT_FALSE(action_2->enabled());
133 palette_tool_manager_->DeactivateTool(action_1->GetToolId()); 135 palette_tool_manager_->DeactivateTool(action_1->GetToolId());
134 } 136 }
OLDNEW
« no previous file with comments | « ash/common/system/chromeos/palette/palette_tool_manager.cc ('k') | ash/common/system/chromeos/palette/palette_tray.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698