OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/aura/root_window.h" | 5 #include "ui/aura/root_window.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 #include "ui/aura/client/event_client.h" | 10 #include "ui/aura/client/event_client.h" |
(...skipping 974 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
985 | 985 |
986 virtual ~RepostGestureEventRecorder() {} | 986 virtual ~RepostGestureEventRecorder() {} |
987 | 987 |
988 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE { | 988 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE { |
989 EXPECT_EQ(reposted_ ? repost_target_ : repost_source_, event->target()); | 989 EXPECT_EQ(reposted_ ? repost_target_ : repost_source_, event->target()); |
990 if (event->type() == ui::ET_GESTURE_TAP_DOWN) { | 990 if (event->type() == ui::ET_GESTURE_TAP_DOWN) { |
991 if (!reposted_) { | 991 if (!reposted_) { |
992 EXPECT_NE(repost_target_, event->target()); | 992 EXPECT_NE(repost_target_, event->target()); |
993 reposted_ = true; | 993 reposted_ = true; |
994 events().clear(); | 994 events().clear(); |
995 repost_target_->GetRootWindow()->RepostEvent(*event); | 995 repost_target_->GetDispatcher()->RepostEvent(*event); |
996 // Ensure that the reposted gesture event above goes to the | 996 // Ensure that the reposted gesture event above goes to the |
997 // repost_target_; | 997 // repost_target_; |
998 repost_source_->GetRootWindow()->RemoveChild(repost_source_); | 998 repost_source_->GetRootWindow()->RemoveChild(repost_source_); |
999 return; | 999 return; |
1000 } | 1000 } |
1001 } | 1001 } |
1002 EventFilterRecorder::OnGestureEvent(event); | 1002 EventFilterRecorder::OnGestureEvent(event); |
1003 } | 1003 } |
1004 | 1004 |
1005 // Ignore mouse events as they don't fire at all times. This causes | 1005 // Ignore mouse events as they don't fire at all times. This causes |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1174 // Owned by RootWindow. | 1174 // Owned by RootWindow. |
1175 Window* w1 = CreateNormalWindow(1, root_window.get(), NULL); | 1175 Window* w1 = CreateNormalWindow(1, root_window.get(), NULL); |
1176 w1->AddObserver(&observer); | 1176 w1->AddObserver(&observer); |
1177 } | 1177 } |
1178 EXPECT_TRUE(got_destroying); | 1178 EXPECT_TRUE(got_destroying); |
1179 EXPECT_TRUE(has_valid_root); | 1179 EXPECT_TRUE(has_valid_root); |
1180 } | 1180 } |
1181 | 1181 |
1182 } // namespace aura | 1182 } // namespace aura |
1183 | 1183 |
OLD | NEW |