OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "apps/ui/native_app_window.h" | 5 #include "apps/ui/native_app_window.h" |
6 #include "chrome/browser/apps/app_browsertest_util.h" | 6 #include "chrome/browser/apps/app_browsertest_util.h" |
7 | 7 |
8 using extensions::Extension; | 8 using extensions::Extension; |
9 | 9 |
10 namespace apps { | 10 namespace apps { |
11 | 11 |
12 namespace { | 12 namespace { |
13 | 13 |
14 typedef extensions::PlatformAppBrowserTest AppWindowBrowserTest; | 14 typedef extensions::PlatformAppBrowserTest AppWindowBrowserTest; |
15 | 15 |
16 #if defined(TOOLKIT_GTK) | 16 // This test is disabled on Linux because of the unpredictable nature of native |
| 17 // windows. We cannot assume that the window manager will insert any title bar |
| 18 // at all, so the test may fail on certain window managers. |
| 19 #if defined(TOOLKIT_GTK) || (defined(OS_LINUX) && !defined(OS_CHROMEOS)) |
17 #define MAYBE_FrameInsetsForDefaultFrame DISABLED_FrameInsetsForDefaultFrame | 20 #define MAYBE_FrameInsetsForDefaultFrame DISABLED_FrameInsetsForDefaultFrame |
18 #else | 21 #else |
19 #define MAYBE_FrameInsetsForDefaultFrame FrameInsetsForDefaultFrame | 22 #define MAYBE_FrameInsetsForDefaultFrame FrameInsetsForDefaultFrame |
20 #endif | 23 #endif |
21 | 24 |
22 // Verifies that the NativeAppWindows implement GetFrameInsets() correctly. | 25 // Verifies that the NativeAppWindows implement GetFrameInsets() correctly. |
23 // See crbug.com/346115 | 26 // See crbug.com/346115 |
24 IN_PROC_BROWSER_TEST_F(AppWindowBrowserTest, MAYBE_FrameInsetsForDefaultFrame) { | 27 IN_PROC_BROWSER_TEST_F(AppWindowBrowserTest, MAYBE_FrameInsetsForDefaultFrame) { |
25 AppWindow* app_window = CreateTestAppWindow("{}"); | 28 AppWindow* app_window = CreateTestAppWindow("{}"); |
26 NativeAppWindow* native_window = app_window->GetBaseWindow(); | 29 NativeAppWindow* native_window = app_window->GetBaseWindow(); |
27 gfx::Insets insets = native_window->GetFrameInsets(); | 30 gfx::Insets insets = native_window->GetFrameInsets(); |
28 | 31 |
29 // It is a reasonable assumption that the top padding must be greater than | 32 // It is a reasonable assumption that the top padding must be greater than |
30 // the bottom padding due to the title bar. | 33 // the bottom padding due to the title bar. |
31 EXPECT_TRUE(insets.top() > insets.bottom()); | 34 EXPECT_TRUE(insets.top() > insets.bottom()); |
32 | 35 |
33 CloseAppWindow(app_window); | 36 CloseAppWindow(app_window); |
34 } | 37 } |
35 | 38 |
36 #if defined(TOOLKIT_GTK) | 39 // This test is also disabled on Linux because frame: color is ignored on stable |
| 40 // and beta channels (so it can fail the same as the previous test). |
| 41 // TODO(benwells): Re-enable on Linux after frame: color is on stable. |
| 42 #if defined(TOOLKIT_GTK) || (defined(OS_LINUX) && !defined(OS_CHROMEOS)) |
37 #define MAYBE_FrameInsetsForColoredFrame DISABLED_FrameInsetsForColoredFrame | 43 #define MAYBE_FrameInsetsForColoredFrame DISABLED_FrameInsetsForColoredFrame |
38 #else | 44 #else |
39 #define MAYBE_FrameInsetsForColoredFrame FrameInsetsForColoredFrame | 45 #define MAYBE_FrameInsetsForColoredFrame FrameInsetsForColoredFrame |
40 #endif | 46 #endif |
41 | 47 |
42 // Verifies that the NativeAppWindows implement GetFrameInsets() correctly. | 48 // Verifies that the NativeAppWindows implement GetFrameInsets() correctly. |
43 // See crbug.com/346115 | 49 // See crbug.com/346115 |
44 IN_PROC_BROWSER_TEST_F(AppWindowBrowserTest, MAYBE_FrameInsetsForColoredFrame) { | 50 IN_PROC_BROWSER_TEST_F(AppWindowBrowserTest, MAYBE_FrameInsetsForColoredFrame) { |
45 AppWindow* app_window = | 51 AppWindow* app_window = |
46 CreateTestAppWindow("{ \"frame\": { \"color\": \"#ffffff\" } }"); | 52 CreateTestAppWindow("{ \"frame\": { \"color\": \"#ffffff\" } }"); |
(...skipping 19 matching lines...) Expand all Loading... |
66 EXPECT_EQ(0, insets.bottom()); | 72 EXPECT_EQ(0, insets.bottom()); |
67 EXPECT_EQ(0, insets.left()); | 73 EXPECT_EQ(0, insets.left()); |
68 EXPECT_EQ(0, insets.right()); | 74 EXPECT_EQ(0, insets.right()); |
69 | 75 |
70 CloseAppWindow(app_window); | 76 CloseAppWindow(app_window); |
71 } | 77 } |
72 | 78 |
73 } // namespace | 79 } // namespace |
74 | 80 |
75 } // namespace apps | 81 } // namespace apps |
OLD | NEW |