OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 #include "chrome/browser/ui/browser.h" | 6 #include "chrome/browser/ui/browser.h" |
7 #include "chrome/browser/ui/browser_tabstrip.h" | 7 #include "chrome/browser/ui/browser_tabstrip.h" |
8 #include "chrome/browser/ui/browser_window.h" | 8 #include "chrome/browser/ui/browser_window.h" |
9 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h" | 9 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h" |
10 #include "chrome/browser/ui/fullscreen/fullscreen_controller_state_test.h" | 10 #include "chrome/browser/ui/fullscreen/fullscreen_controller_state_test.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 // state issues that would bleed over to other states. | 47 // state issues that would bleed over to other states. |
48 // I.E. for each state test all combinations of events E1, E2, E3. | 48 // I.E. for each state test all combinations of events E1, E2, E3. |
49 // | 49 // |
50 // This produces coverage for event sequences that may happen normally but | 50 // This produces coverage for event sequences that may happen normally but |
51 // would not be exposed by traversing to each state via TransitionToState(). | 51 // would not be exposed by traversing to each state via TransitionToState(). |
52 // TransitionToState() always takes the same path even when multiple paths | 52 // TransitionToState() always takes the same path even when multiple paths |
53 // exist. | 53 // exist. |
54 IN_PROC_BROWSER_TEST_F(FullscreenControllerStateInteractiveTest, | 54 IN_PROC_BROWSER_TEST_F(FullscreenControllerStateInteractiveTest, |
55 DISABLED_TransitionsForEachState) { | 55 DISABLED_TransitionsForEachState) { |
56 // A tab is needed for tab fullscreen. | 56 // A tab is needed for tab fullscreen. |
57 AddTabAtIndex(0, GURL(content::kAboutBlankURL), | 57 AddTabAtIndex(0, GURL(url::kAboutBlankURL), content::PAGE_TRANSITION_TYPED); |
58 content::PAGE_TRANSITION_TYPED); | |
59 TestTransitionsForEachState(); | 58 TestTransitionsForEachState(); |
60 // Progress of test can be examined via LOG(INFO) << GetAndClearDebugLog(); | 59 // Progress of test can be examined via LOG(INFO) << GetAndClearDebugLog(); |
61 } | 60 } |
62 | 61 |
63 | 62 |
64 // Individual tests for each pair of state and event --------------------------- | 63 // Individual tests for each pair of state and event --------------------------- |
65 | 64 |
66 // An "empty" test is included as part of each "TEST_EVENT" because it makes | 65 // An "empty" test is included as part of each "TEST_EVENT" because it makes |
67 // running the entire test suite less flaky on MacOS. All of the tests pass | 66 // running the entire test suite less flaky on MacOS. All of the tests pass |
68 // when run individually. | 67 // when run individually. |
69 #define TEST_EVENT(state, event) \ | 68 #define TEST_EVENT(state, event) \ |
70 IN_PROC_BROWSER_TEST_F(FullscreenControllerStateInteractiveTest, \ | 69 IN_PROC_BROWSER_TEST_F(FullscreenControllerStateInteractiveTest, \ |
71 DISABLED_##state##__##event##__Empty) { \ | 70 DISABLED_##state##__##event##__Empty) {} \ |
72 } \ | 71 IN_PROC_BROWSER_TEST_F(FullscreenControllerStateInteractiveTest, \ |
73 IN_PROC_BROWSER_TEST_F(FullscreenControllerStateInteractiveTest, \ | 72 DISABLED_##state##__##event) { \ |
74 DISABLED_##state##__##event) { \ | 73 AddTabAtIndex( \ |
75 AddTabAtIndex(0, GURL(content::kAboutBlankURL), \ | 74 0, GURL(url::kAboutBlankURL), content::PAGE_TRANSITION_TYPED); \ |
76 content::PAGE_TRANSITION_TYPED); \ | 75 ASSERT_NO_FATAL_FAILURE(TestStateAndEvent(state, event)) \ |
77 ASSERT_NO_FATAL_FAILURE(TestStateAndEvent(state, event)) \ | 76 << GetAndClearDebugLog(); \ |
78 << GetAndClearDebugLog(); \ | 77 } |
79 } | |
80 // Progress of tests can be examined by inserting the following line: | 78 // Progress of tests can be examined by inserting the following line: |
81 // LOG(INFO) << GetAndClearDebugLog(); } | 79 // LOG(INFO) << GetAndClearDebugLog(); } |
82 | 80 |
83 #include "chrome/browser/ui/fullscreen/fullscreen_controller_state_tests.h" | 81 #include "chrome/browser/ui/fullscreen/fullscreen_controller_state_tests.h" |
84 | 82 |
85 | 83 |
86 // Specific one-off tests for known issues ------------------------------------- | 84 // Specific one-off tests for known issues ------------------------------------- |
87 | 85 |
88 // Used manually to determine what happens on a platform. | 86 // Used manually to determine what happens on a platform. |
89 IN_PROC_BROWSER_TEST_F(FullscreenControllerStateInteractiveTest, | 87 IN_PROC_BROWSER_TEST_F(FullscreenControllerStateInteractiveTest, |
90 DISABLED_ManualTest) { | 88 DISABLED_ManualTest) { |
91 // A tab is needed for tab fullscreen. | 89 // A tab is needed for tab fullscreen. |
92 AddTabAtIndex(0, GURL(content::kAboutBlankURL), | 90 AddTabAtIndex(0, GURL(url::kAboutBlankURL), content::PAGE_TRANSITION_TYPED); |
93 content::PAGE_TRANSITION_TYPED); | |
94 ASSERT_TRUE(InvokeEvent(TOGGLE_FULLSCREEN)) << GetAndClearDebugLog(); | 91 ASSERT_TRUE(InvokeEvent(TOGGLE_FULLSCREEN)) << GetAndClearDebugLog(); |
95 ASSERT_TRUE(InvokeEvent(WINDOW_CHANGE)) << GetAndClearDebugLog(); | 92 ASSERT_TRUE(InvokeEvent(WINDOW_CHANGE)) << GetAndClearDebugLog(); |
96 ASSERT_TRUE(InvokeEvent(TAB_FULLSCREEN_TRUE)) << GetAndClearDebugLog(); | 93 ASSERT_TRUE(InvokeEvent(TAB_FULLSCREEN_TRUE)) << GetAndClearDebugLog(); |
97 ASSERT_TRUE(InvokeEvent(TOGGLE_FULLSCREEN)) << GetAndClearDebugLog(); | 94 ASSERT_TRUE(InvokeEvent(TOGGLE_FULLSCREEN)) << GetAndClearDebugLog(); |
98 ASSERT_TRUE(InvokeEvent(WINDOW_CHANGE)) << GetAndClearDebugLog(); | 95 ASSERT_TRUE(InvokeEvent(WINDOW_CHANGE)) << GetAndClearDebugLog(); |
99 | 96 |
100 // Wait, allowing human operator to observe the result. | 97 // Wait, allowing human operator to observe the result. |
101 scoped_refptr<content::MessageLoopRunner> message_loop | 98 scoped_refptr<content::MessageLoopRunner> message_loop |
102 = new content::MessageLoopRunner(); | 99 = new content::MessageLoopRunner(); |
103 message_loop->Run(); | 100 message_loop->Run(); |
104 } | 101 } |
105 | 102 |
OLD | NEW |