Index: chrome/browser/fullscreen_chromeos_unittest.cc |
diff --git a/chrome/browser/fullscreen_chromeos_unittest.cc b/chrome/browser/fullscreen_chromeos_unittest.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..5b7a1489d3e9c19e67d7bc9e892eb948e7f87da9 |
--- /dev/null |
+++ b/chrome/browser/fullscreen_chromeos_unittest.cc |
@@ -0,0 +1,41 @@ |
+#include "ash/test/ash_test_base.h" |
sky
2013/04/23 22:34:08
You're missing the copright header here.
|
+ |
+#include "chrome/browser/fullscreen.h" |
+#include "ui/aura/root_window.h" |
+#include "ui/views/widget/widget.h" |
+ |
+namespace ash { |
+namespace { |
+ |
+typedef ash::test::AshTestBase FullscreenChromeOSTest; |
+ |
+// Test that IsFullScreenMode() still returns true if the active window's |
+// transient parent is fullscreen. A transient window can be visible while in |
+// fullscreen if a user opens a dialog (eg the bookmkark bubble) while the |
+// top-of-window views are revealed in immersive fullscreen. |
+TEST_F(FullscreenChromeOSTest, TransientParentIsFullscreen) { |
+ views::Widget::InitParams parent_params; |
+ parent_params.context = CurrentContext(); |
+ parent_params.bounds = gfx::Rect(0, 0, 100, 100); |
+ |
+ views::Widget* parent = new views::Widget(); |
+ parent->Init(parent_params); |
+ parent->SetFullscreen(true); |
+ parent->Show(); |
+ |
+ // |child| is a transient child of |parent|. |
+ views::Widget::InitParams child_params; |
+ child_params.parent = parent->GetNativeView(); |
+ child_params.bounds = gfx::Rect(0, 0, 100, 100); |
+ |
+ views::Widget* child = new views::Widget(); |
+ child->Init(child_params); |
+ child->Show(); |
+ child->Activate(); |
+ ASSERT_TRUE(child->IsActive()); |
+ |
+ EXPECT_TRUE(IsFullScreenMode()); |
sky
2013/04/23 22:34:08
How about an expect for !InFullScreenMode above?
|
+} |
+ |
+} // namespace |
+} // namespace ash |