OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/location_bar/page_action_image_view.h" | 5 #include "chrome/browser/ui/views/location_bar/page_action_image_view.h" |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "chrome/browser/extensions/extension_action_manager.h" | 9 #include "chrome/browser/extensions/extension_action_manager.h" |
10 #include "chrome/browser/extensions/extension_browsertest.h" | 10 #include "chrome/browser/extensions/extension_browsertest.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 ~PageActionImageViewInteractiveUITest() override {} | 29 ~PageActionImageViewInteractiveUITest() override {} |
30 | 30 |
31 void SetUpCommandLine(base::CommandLine* command_line) override { | 31 void SetUpCommandLine(base::CommandLine* command_line) override { |
32 ExtensionBrowserTest::SetUpCommandLine(command_line); | 32 ExtensionBrowserTest::SetUpCommandLine(command_line); |
33 // Testing page action-specific UI means we need to disable the redesign. | 33 // Testing page action-specific UI means we need to disable the redesign. |
34 disable_redesign_.reset(new extensions::FeatureSwitch::ScopedOverride( | 34 disable_redesign_.reset(new extensions::FeatureSwitch::ScopedOverride( |
35 extensions::FeatureSwitch::extension_action_redesign(), false)); | 35 extensions::FeatureSwitch::extension_action_redesign(), false)); |
36 } | 36 } |
37 | 37 |
38 private: | 38 private: |
39 scoped_ptr<extensions::FeatureSwitch::ScopedOverride> disable_redesign_; | 39 std::unique_ptr<extensions::FeatureSwitch::ScopedOverride> disable_redesign_; |
40 | 40 |
41 DISALLOW_COPY_AND_ASSIGN(PageActionImageViewInteractiveUITest); | 41 DISALLOW_COPY_AND_ASSIGN(PageActionImageViewInteractiveUITest); |
42 }; | 42 }; |
43 | 43 |
44 // An ImageSkia source that will do nothing. We need this because we need a | 44 // An ImageSkia source that will do nothing. We need this because we need a |
45 // blank canvas at a certain size, and that can't be done by just using a null | 45 // blank canvas at a certain size, and that can't be done by just using a null |
46 // ImageSkia. | 46 // ImageSkia. |
47 class BlankImageSource : public gfx::CanvasImageSource { | 47 class BlankImageSource : public gfx::CanvasImageSource { |
48 public: | 48 public: |
49 explicit BlankImageSource(const gfx::Size& size) | 49 explicit BlankImageSource(const gfx::Size& size) |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 ui_controls::LEFT, | 177 ui_controls::LEFT, |
178 ui_controls::UP | ui_controls::DOWN, | 178 ui_controls::UP | ui_controls::DOWN, |
179 run_loop.QuitClosure()); | 179 run_loop.QuitClosure()); |
180 run_loop.Run(); | 180 run_loop.Run(); |
181 listener.WaitUntilSatisfied(); | 181 listener.WaitUntilSatisfied(); |
182 } | 182 } |
183 | 183 |
184 // Since the action ran, it should no longer be visible. | 184 // Since the action ran, it should no longer be visible. |
185 EXPECT_EQ(0, location_bar_testing->PageActionVisibleCount()); | 185 EXPECT_EQ(0, location_bar_testing->PageActionVisibleCount()); |
186 } | 186 } |
OLD | NEW |