Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/views/test/widget_test.h" | 5 #include "ui/views/test/widget_test.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 39 EXPECT_TRUE(std::equal(expected->begin(), expected->end(), actual.begin())); | 39 EXPECT_TRUE(std::equal(expected->begin(), expected->end(), actual.begin())); |
| 40 } | 40 } |
| 41 | 41 |
| 42 } // namespace | 42 } // namespace |
| 43 | 43 |
| 44 using WidgetTestTest = WidgetTest; | 44 using WidgetTestTest = WidgetTest; |
| 45 | 45 |
| 46 // Ensure that Widgets with various root windows are correctly reported by | 46 // Ensure that Widgets with various root windows are correctly reported by |
| 47 // WidgetTest::GetAllWidgets(). | 47 // WidgetTest::GetAllWidgets(). |
| 48 TEST_F(WidgetTestTest, GetAllWidgets) { | 48 TEST_F(WidgetTestTest, GetAllWidgets) { |
| 49 // TODO: this test transitively uses GetContext(). That should go away for | |
| 50 // aura-mus client. http://crbug.com/663781. | |
|
Elliot Glaysher
2017/04/10 23:46:14
This is an example of a test which was only succee
| |
| 51 if (IsMus()) | |
| 52 return; | |
| 53 | |
| 49 // Note Widget::Widgets is a std::set ordered by pointer value, so the order | 54 // Note Widget::Widgets is a std::set ordered by pointer value, so the order |
| 50 // that |expected| is updated below is not important. | 55 // that |expected| is updated below is not important. |
| 51 Widget::Widgets expected; | 56 Widget::Widgets expected; |
| 52 | 57 |
| 53 EXPECT_EQ(expected, GetAllWidgets()); | 58 EXPECT_EQ(expected, GetAllWidgets()); |
| 54 | 59 |
| 55 Widget* platform = CreateTopLevelPlatformWidget(); | 60 Widget* platform = CreateTopLevelPlatformWidget(); |
| 56 ExpectAdd(&expected, platform, "platform"); | 61 ExpectAdd(&expected, platform, "platform"); |
| 57 | 62 |
| 58 Widget* platform_child = CreateChildPlatformWidget(platform->GetNativeView()); | 63 Widget* platform_child = CreateChildPlatformWidget(platform->GetNativeView()); |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 84 #endif // USE_AURA | 89 #endif // USE_AURA |
| 85 | 90 |
| 86 ExpectClose(&expected, {desktop, desktop_child}, "desktop"); | 91 ExpectClose(&expected, {desktop, desktop_child}, "desktop"); |
| 87 ExpectClose(&expected, {native, native_child}, "native"); | 92 ExpectClose(&expected, {native, native_child}, "native"); |
| 88 ExpectClose(&expected, {platform, platform_child}, "platform"); | 93 ExpectClose(&expected, {platform, platform_child}, "platform"); |
| 89 ExpectClose(&expected, {frameless}, "frameless"); | 94 ExpectClose(&expected, {frameless}, "frameless"); |
| 90 } | 95 } |
| 91 | 96 |
| 92 } // namespace views | 97 } // namespace views |
| 93 } // namespace test | 98 } // namespace test |
| OLD | NEW |