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

Side by Side Diff: views/view_unittest.cc

Issue 7189019: Fix even more crashes. To help identify remaining crashes now and in the future, I have made the ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <map> 5 #include <map>
6 6
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "testing/gmock/include/gmock/gmock.h" 9 #include "testing/gmock/include/gmock/gmock.h"
10 #include "ui/base/clipboard/clipboard.h" 10 #include "ui/base/clipboard/clipboard.h"
(...skipping 1065 matching lines...) Expand 10 before | Expand all | Expand 10 after
1076 }; 1076 };
1077 1077
1078 class SimpleWidgetDelegate : public WidgetDelegate { 1078 class SimpleWidgetDelegate : public WidgetDelegate {
1079 public: 1079 public:
1080 explicit SimpleWidgetDelegate(View* contents) : contents_(contents) { } 1080 explicit SimpleWidgetDelegate(View* contents) : contents_(contents) { }
1081 1081
1082 virtual void DeleteDelegate() { delete this; } 1082 virtual void DeleteDelegate() { delete this; }
1083 1083
1084 virtual View* GetContentsView() { return contents_; } 1084 virtual View* GetContentsView() { return contents_; }
1085 1085
1086 virtual Widget* GetWidget() { return contents_->GetWidget(); }
1087 virtual const Widget* GetWidget() const { return contents_->GetWidget(); }
1088
1086 private: 1089 private:
1087 View* contents_; 1090 View* contents_;
1088 }; 1091 };
1089 1092
1090 // Tests that the mouse-wheel messages are correctly rerouted to the window 1093 // Tests that the mouse-wheel messages are correctly rerouted to the window
1091 // under the mouse. 1094 // under the mouse.
1092 // TODO(jcampan): http://crbug.com/10572 Disabled as it fails on the Vista build 1095 // TODO(jcampan): http://crbug.com/10572 Disabled as it fails on the Vista build
1093 // bot. 1096 // bot.
1094 // Note that this fails for a variety of reasons: 1097 // Note that this fails for a variety of reasons:
1095 // - focused view is apparently reset across window activations and never 1098 // - focused view is apparently reset across window activations and never
(...skipping 1009 matching lines...) Expand 10 before | Expand all | Expand 10 after
2105 ASSERT_EQ(0, child1->GetIndexOf(foo1)); 2108 ASSERT_EQ(0, child1->GetIndexOf(foo1));
2106 2109
2107 ASSERT_EQ(-1, child2->GetIndexOf(NULL)); 2110 ASSERT_EQ(-1, child2->GetIndexOf(NULL));
2108 ASSERT_EQ(-1, child2->GetIndexOf(&root)); 2111 ASSERT_EQ(-1, child2->GetIndexOf(&root));
2109 ASSERT_EQ(-1, child2->GetIndexOf(child2)); 2112 ASSERT_EQ(-1, child2->GetIndexOf(child2));
2110 ASSERT_EQ(-1, child2->GetIndexOf(child1)); 2113 ASSERT_EQ(-1, child2->GetIndexOf(child1));
2111 ASSERT_EQ(-1, child2->GetIndexOf(foo1)); 2114 ASSERT_EQ(-1, child2->GetIndexOf(foo1));
2112 } 2115 }
2113 2116
2114 } // namespace views 2117 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698