| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 TEST_TYPE_START, | 76 TEST_TYPE_START, |
| 76 PROMPTING = TEST_TYPE_START, | 77 PROMPTING = TEST_TYPE_START, |
| 77 SIMPLIFIED, | 78 SIMPLIFIED, |
| 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 // content::BrowserTestBase: | |
| 88 void SetUpCommandLine(base::CommandLine* command_line) override { | |
| 89 switch (GetParam()) { | 87 switch (GetParam()) { |
| 90 case PROMPTING: | 88 case PROMPTING: |
| 91 command_line->AppendSwitchASCII(switches::kDisableFeatures, | 89 scoped_feature_list_.InitAndDisableFeature( |
| 92 features::kSimplifiedFullscreenUI.name); | 90 features::kSimplifiedFullscreenUI); |
| 93 break; | 91 break; |
| 94 case SIMPLIFIED: | 92 case SIMPLIFIED: |
| 95 command_line->AppendSwitchASCII(switches::kEnableFeatures, | 93 scoped_feature_list_.InitAndEnableFeature( |
| 96 features::kSimplifiedFullscreenUI.name); | 94 features::kSimplifiedFullscreenUI); |
| 97 break; | 95 break; |
| 98 default: | 96 default: |
| 99 NOTREACHED(); | 97 NOTREACHED(); |
| 100 } | 98 } |
| 101 } | 99 } |
| 102 | 100 |
| 103 private: | 101 private: |
| 102 base::test::ScopedFeatureList scoped_feature_list_; |
| 104 DISALLOW_COPY_AND_ASSIGN(ParamaterizedFullscreenControllerInteractiveTest); | 103 DISALLOW_COPY_AND_ASSIGN(ParamaterizedFullscreenControllerInteractiveTest); |
| 105 }; | 104 }; |
| 106 | 105 |
| 107 void FullscreenControllerInteractiveTest::ToggleTabFullscreen( | 106 void FullscreenControllerInteractiveTest::ToggleTabFullscreen( |
| 108 bool enter_fullscreen) { | 107 bool enter_fullscreen) { |
| 109 ToggleTabFullscreen_Internal(enter_fullscreen, true); | 108 ToggleTabFullscreen_Internal(enter_fullscreen, true); |
| 110 } | 109 } |
| 111 | 110 |
| 112 // |ToggleTabFullscreen| should not need to tolerate the transition failing. | 111 // |ToggleTabFullscreen| should not need to tolerate the transition failing. |
| 113 // Most fullscreen tests run sharded in fullscreen_controller_browsertest.cc | 112 // 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)); | 710 ASSERT_NO_FATAL_FAILURE(ToggleTabFullscreenNoRetries(true)); |
| 712 ASSERT_TRUE(IsWindowFullscreenForTabOrPending()); | 711 ASSERT_TRUE(IsWindowFullscreenForTabOrPending()); |
| 713 ASSERT_NO_FATAL_FAILURE(ToggleTabFullscreenNoRetries(false)); | 712 ASSERT_NO_FATAL_FAILURE(ToggleTabFullscreenNoRetries(false)); |
| 714 ASSERT_FALSE(IsWindowFullscreenForTabOrPending()); | 713 ASSERT_FALSE(IsWindowFullscreenForTabOrPending()); |
| 715 } | 714 } |
| 716 | 715 |
| 717 INSTANTIATE_TEST_CASE_P( | 716 INSTANTIATE_TEST_CASE_P( |
| 718 ParamaterizedFullscreenControllerInteractiveTestInstance, | 717 ParamaterizedFullscreenControllerInteractiveTestInstance, |
| 719 ParamaterizedFullscreenControllerInteractiveTest, | 718 ParamaterizedFullscreenControllerInteractiveTest, |
| 720 ::testing::Range<int>(TEST_TYPE_START, TEST_TYPE_END)); | 719 ::testing::Range<int>(TEST_TYPE_START, TEST_TYPE_END)); |
| OLD | NEW |