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

Side by Side Diff: ui/events/event_processor_unittest.cc

Issue 1081103008: Update {virtual,override} to follow C++11 style in ui. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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
« no previous file with comments | « ui/base/resource/resource_bundle_unittest.cc ('k') | ui/events/event_target_iterator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <vector> 5 #include <vector>
6 6
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 #include "ui/events/event.h" 8 #include "ui/events/event.h"
9 #include "ui/events/event_targeter.h" 9 #include "ui/events/event_targeter.h"
10 #include "ui/events/event_utils.h" 10 #include "ui/events/event_utils.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 EXPECT_FALSE(root()->DidReceiveEvent(ET_MOUSE_MOVED)); 59 EXPECT_FALSE(root()->DidReceiveEvent(ET_MOUSE_MOVED));
60 60
61 root()->RemoveChild(root()->child_at(0)); 61 root()->RemoveChild(root()->child_at(0));
62 DispatchEvent(&mouse); 62 DispatchEvent(&mouse);
63 EXPECT_TRUE(root()->DidReceiveEvent(ET_MOUSE_MOVED)); 63 EXPECT_TRUE(root()->DidReceiveEvent(ET_MOUSE_MOVED));
64 } 64 }
65 65
66 template<typename T> 66 template<typename T>
67 class BoundsEventTargeter : public EventTargeter { 67 class BoundsEventTargeter : public EventTargeter {
68 public: 68 public:
69 virtual ~BoundsEventTargeter() {} 69 ~BoundsEventTargeter() override {}
70 70
71 protected: 71 protected:
72 virtual bool SubtreeShouldBeExploredForEvent( 72 bool SubtreeShouldBeExploredForEvent(
73 EventTarget* target, const LocatedEvent& event) override { 73 EventTarget* target, const LocatedEvent& event) override {
74 T* t = static_cast<T*>(target); 74 T* t = static_cast<T*>(target);
75 return (t->bounds().Contains(event.location())); 75 return (t->bounds().Contains(event.location()));
76 } 76 }
77 }; 77 };
78 78
79 class BoundsTestTarget : public TestEventTarget { 79 class BoundsTestTarget : public TestEventTarget {
80 public: 80 public:
81 BoundsTestTarget() {} 81 BoundsTestTarget() {}
82 ~BoundsTestTarget() override {} 82 ~BoundsTestTarget() override {}
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 DispatchEvent(&mouse); 515 DispatchEvent(&mouse);
516 516
517 std::string expected[] = { "PreR", "PreC", "PreG", "G", "PostG", "PostC", 517 std::string expected[] = { "PreR", "PreC", "PreG", "G", "PostG", "PostC",
518 "PostR", "PreR", "PreC", "C", "PostC", "PostR", "PreR", "R", "PostR" }; 518 "PostR", "PreR", "PreC", "C", "PostC", "PostR", "PreR", "R", "PostR" };
519 EXPECT_EQ(std::vector<std::string>( 519 EXPECT_EQ(std::vector<std::string>(
520 expected, expected + arraysize(expected)), recorder); 520 expected, expected + arraysize(expected)), recorder);
521 } 521 }
522 522
523 } // namespace test 523 } // namespace test
524 } // namespace ui 524 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/resource/resource_bundle_unittest.cc ('k') | ui/events/event_target_iterator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698