Chromium Code Reviews| Index: chrome/browser/ui/exclusive_access/fullscreen_controller_state_unittest.cc |
| diff --git a/chrome/browser/ui/exclusive_access/fullscreen_controller_state_unittest.cc b/chrome/browser/ui/exclusive_access/fullscreen_controller_state_unittest.cc |
| index 9bd0d34ede37a9019e858f2abdc4fbb30c5a845a..f1129e585528d9bf55d4aaa82afa4f88b2aa306a 100644 |
| --- a/chrome/browser/ui/exclusive_access/fullscreen_controller_state_unittest.cc |
| +++ b/chrome/browser/ui/exclusive_access/fullscreen_controller_state_unittest.cc |
| @@ -3,6 +3,7 @@ |
| // found in the LICENSE file. |
| #include "base/command_line.h" |
| +#include "base/test/histogram_tester.h" |
| #include "build/build_config.h" |
| #include "chrome/browser/ui/browser.h" |
| #include "chrome/browser/ui/browser_tabstrip.h" |
| @@ -20,6 +21,10 @@ |
| // the FullscreenController through all permutations of events. The behavior |
| // of the BrowserWindow is mocked via FullscreenControllerTestWindow. |
| +namespace { |
| + |
| +const char kFullscreenReshowHistogramName[] = |
| + "ExclusiveAccess.FullscreenBubbleReshowsPerSession"; |
| // FullscreenControllerTestWindow ---------------------------------------------- |
| @@ -246,6 +251,8 @@ void FullscreenControllerTestWindow::UpdateExclusiveAccessExitBubbleContent( |
| void FullscreenControllerTestWindow::OnExclusiveAccessUserInput() {} |
| +} // namespace |
| + |
| // FullscreenControllerStateUnitTest ------------------------------------------- |
| // Unit test fixture testing Fullscreen Controller through its states. Most of |
| @@ -474,15 +481,22 @@ TEST_F(FullscreenControllerStateUnitTest, |
| // Test that switching tabs takes the browser out of tab fullscreen. |
| TEST_F(FullscreenControllerStateUnitTest, ExitTabFullscreenViaSwitchingTab) { |
| + base::HistogramTester histogram_tester; |
| + |
| AddTab(browser(), GURL(url::kAboutBlankURL)); |
| AddTab(browser(), GURL(url::kAboutBlankURL)); |
| ASSERT_TRUE(InvokeEvent(TAB_FULLSCREEN_TRUE)); |
| ASSERT_TRUE(InvokeEvent(WINDOW_CHANGE)); |
| ASSERT_TRUE(browser()->window()->IsFullscreen()); |
| + histogram_tester.ExpectTotalCount(kFullscreenReshowHistogramName, 0); |
| browser()->tab_strip_model()->SelectNextTab(); |
| ChangeWindowFullscreenState(); |
| EXPECT_FALSE(browser()->window()->IsFullscreen()); |
| + |
| + // Do a simple test that histograms are being recorded upon exiting the |
| + // fullscreen session. |
| + histogram_tester.ExpectUniqueSample(kFullscreenReshowHistogramName, 0, 1); |
|
dominickn
2016/02/23 00:05:27
Nit: is there a test that reshows the bubble so yo
Matt Giuca
2016/02/23 02:50:28
No, there isn't. I tried writing some minimal test
dominickn
2016/02/23 03:05:53
Acknowledged.
|
| } |
| // Test that switching tabs via detaching the active tab (which is in tab |