OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "ash/wm/partial_screenshot_view.h" | 5 #include "ash/wm/partial_screenshot_view.h" |
6 | 6 |
7 #include "ash/screenshot_delegate.h" | 7 #include "ash/screenshot_delegate.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/shell_window_ids.h" | 9 #include "ash/shell_window_ids.h" |
10 #include "ash/test/ash_test_base.h" | 10 #include "ash/test/ash_test_base.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 view_ = views[0]; | 33 view_ = views[0]; |
34 view_->GetWidget()->AddObserver(this); | 34 view_->GetWidget()->AddObserver(this); |
35 } | 35 } |
36 } | 36 } |
37 | 37 |
38 protected: | 38 protected: |
39 PartialScreenshotView* view_; | 39 PartialScreenshotView* view_; |
40 | 40 |
41 private: | 41 private: |
42 // views::WidgetObserver: | 42 // views::WidgetObserver: |
43 virtual void OnWidgetDestroying(views::Widget* widget) OVERRIDE { | 43 virtual void OnWidgetDestroying(views::Widget* widget) override { |
44 if (view_ && view_->GetWidget() == widget) | 44 if (view_ && view_->GetWidget() == widget) |
45 view_ = NULL; | 45 view_ = NULL; |
46 widget->RemoveObserver(this); | 46 widget->RemoveObserver(this); |
47 } | 47 } |
48 | 48 |
49 DISALLOW_COPY_AND_ASSIGN(PartialScreenshotViewTest); | 49 DISALLOW_COPY_AND_ASSIGN(PartialScreenshotViewTest); |
50 }; | 50 }; |
51 | 51 |
52 TEST_F(PartialScreenshotViewTest, BasicMouse) { | 52 TEST_F(PartialScreenshotViewTest, BasicMouse) { |
53 StartPartialScreenshot(); | 53 StartPartialScreenshot(); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 | 113 |
114 // Someone else attempts to activate the overlay session, which should cancel | 114 // Someone else attempts to activate the overlay session, which should cancel |
115 // the current partial screenshot session. | 115 // the current partial screenshot session. |
116 overlay_filter->Activate(&delegate); | 116 overlay_filter->Activate(&delegate); |
117 RunAllPendingInMessageLoop(); | 117 RunAllPendingInMessageLoop(); |
118 EXPECT_EQ(&delegate, overlay_filter->delegate_); | 118 EXPECT_EQ(&delegate, overlay_filter->delegate_); |
119 EXPECT_TRUE(view_ == NULL); | 119 EXPECT_TRUE(view_ == NULL); |
120 } | 120 } |
121 | 121 |
122 } // namespace ash | 122 } // namespace ash |
OLD | NEW |