| 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/test/scoped_feature_list.h" |
| 6 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 7 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" | 8 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| 10 #include "chrome/browser/ui/browser_commands.h" | 11 #include "chrome/browser/ui/browser_commands.h" |
| 11 #include "chrome/browser/ui/browser_window.h" | 12 #include "chrome/browser/ui/browser_window.h" |
| 12 #include "chrome/browser/ui/exclusive_access/exclusive_access_context.h" | 13 #include "chrome/browser/ui/exclusive_access/exclusive_access_context.h" |
| 13 #include "chrome/browser/ui/exclusive_access/fullscreen_controller_test.h" | 14 #include "chrome/browser/ui/exclusive_access/fullscreen_controller_test.h" |
| 14 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 15 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 15 #include "chrome/common/chrome_features.h" | 16 #include "chrome/common/chrome_features.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 TEST_TYPE_END, | 79 TEST_TYPE_END, |
| 79 }; | 80 }; |
| 80 | 81 |
| 81 class ParamaterizedFullscreenControllerInteractiveTest | 82 class ParamaterizedFullscreenControllerInteractiveTest |
| 82 : public FullscreenControllerInteractiveTest, | 83 : public FullscreenControllerInteractiveTest, |
| 83 public ::testing::WithParamInterface<int> { | 84 public ::testing::WithParamInterface<int> { |
| 84 public: | 85 public: |
| 85 ParamaterizedFullscreenControllerInteractiveTest() {} | 86 ParamaterizedFullscreenControllerInteractiveTest() {} |
| 86 | 87 |
| 87 // content::BrowserTestBase: | 88 // content::BrowserTestBase: |
| 88 void SetUpCommandLine(base::CommandLine* command_line) override { | 89 void SetUp() override { |
| 89 switch (GetParam()) { | 90 switch (GetParam()) { |
| 90 case PROMPTING: | 91 case PROMPTING: |
| 91 command_line->AppendSwitchASCII(switches::kDisableFeatures, | 92 scoped_feature_list_.InitAndDisableFeature( |
| 92 features::kSimplifiedFullscreenUI.name); | 93 features::kSimplifiedFullscreenUI); |
| 93 break; | 94 break; |
| 94 case SIMPLIFIED: | 95 case SIMPLIFIED: |
| 95 command_line->AppendSwitchASCII(switches::kEnableFeatures, | 96 scoped_feature_list_.InitAndEnableFeature( |
| 96 features::kSimplifiedFullscreenUI.name); | 97 features::kSimplifiedFullscreenUI); |
| 97 break; | 98 break; |
| 98 default: | 99 default: |
| 99 NOTREACHED(); | 100 NOTREACHED(); |
| 100 } | 101 } |
| 102 FullscreenControllerInteractiveTest::SetUp(); |
| 101 } | 103 } |
| 102 | 104 |
| 103 private: | 105 private: |
| 106 base::test::ScopedFeatureList scoped_feature_list_; |
| 104 DISALLOW_COPY_AND_ASSIGN(ParamaterizedFullscreenControllerInteractiveTest); | 107 DISALLOW_COPY_AND_ASSIGN(ParamaterizedFullscreenControllerInteractiveTest); |
| 105 }; | 108 }; |
| 106 | 109 |
| 107 void FullscreenControllerInteractiveTest::ToggleTabFullscreen( | 110 void FullscreenControllerInteractiveTest::ToggleTabFullscreen( |
| 108 bool enter_fullscreen) { | 111 bool enter_fullscreen) { |
| 109 ToggleTabFullscreen_Internal(enter_fullscreen, true); | 112 ToggleTabFullscreen_Internal(enter_fullscreen, true); |
| 110 } | 113 } |
| 111 | 114 |
| 112 // |ToggleTabFullscreen| should not need to tolerate the transition failing. | 115 // |ToggleTabFullscreen| should not need to tolerate the transition failing. |
| 113 // Most fullscreen tests run sharded in fullscreen_controller_browsertest.cc | 116 // Most fullscreen tests run sharded in fullscreen_controller_browsertest.cc |
| (...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 711 ASSERT_NO_FATAL_FAILURE(ToggleTabFullscreenNoRetries(true)); | 714 ASSERT_NO_FATAL_FAILURE(ToggleTabFullscreenNoRetries(true)); |
| 712 ASSERT_TRUE(IsWindowFullscreenForTabOrPending()); | 715 ASSERT_TRUE(IsWindowFullscreenForTabOrPending()); |
| 713 ASSERT_NO_FATAL_FAILURE(ToggleTabFullscreenNoRetries(false)); | 716 ASSERT_NO_FATAL_FAILURE(ToggleTabFullscreenNoRetries(false)); |
| 714 ASSERT_FALSE(IsWindowFullscreenForTabOrPending()); | 717 ASSERT_FALSE(IsWindowFullscreenForTabOrPending()); |
| 715 } | 718 } |
| 716 | 719 |
| 717 INSTANTIATE_TEST_CASE_P( | 720 INSTANTIATE_TEST_CASE_P( |
| 718 ParamaterizedFullscreenControllerInteractiveTestInstance, | 721 ParamaterizedFullscreenControllerInteractiveTestInstance, |
| 719 ParamaterizedFullscreenControllerInteractiveTest, | 722 ParamaterizedFullscreenControllerInteractiveTest, |
| 720 ::testing::Range<int>(TEST_TYPE_START, TEST_TYPE_END)); | 723 ::testing::Range<int>(TEST_TYPE_START, TEST_TYPE_END)); |
| OLD | NEW |