Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3941)

Unified Diff: chrome/browser/ui/exclusive_access/fullscreen_controller_interactive_browsertest.cc

Issue 1709803004: Add ViewsSimplifiedFullscreenUI to the fieldtrial testing config on Mac (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Paramaterize Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | testing/variations/fieldtrial_testing_config_mac.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/exclusive_access/fullscreen_controller_interactive_browsertest.cc
diff --git a/chrome/browser/ui/exclusive_access/fullscreen_controller_interactive_browsertest.cc b/chrome/browser/ui/exclusive_access/fullscreen_controller_interactive_browsertest.cc
index ebb9e6672864be321b362a3cd1b1215d4c52cbc4..2ea61120af7eb6744019f326704d63341b12d20f 100644
--- a/chrome/browser/ui/exclusive_access/fullscreen_controller_interactive_browsertest.cc
+++ b/chrome/browser/ui/exclusive_access/fullscreen_controller_interactive_browsertest.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/command_line.h"
#include "build/build_config.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/fullscreen.h"
@@ -19,6 +20,7 @@
#include "content/public/browser/render_widget_host.h"
#include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/web_contents.h"
+#include "content/public/common/content_switches.h"
#include "content/public/common/url_constants.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
@@ -68,6 +70,47 @@ class FullscreenControllerInteractiveTest
bool retry_until_success);
};
+// Allow the test harness to pick the non-simplified fullscreen UI, which
+// prompts with an interactive dialog rather than just notifying the user how to
+// exit fullscreen. TODO(tapted): Remove this when "simplified" is the only way.
+enum TestType {
+ TEST_TYPE_START,
+ PROMPTING = TEST_TYPE_START,
+ SIMPLIFIED,
+ TEST_TYPE_END,
+};
+
+class ParamaterizedFullscreenControllerInteractiveTest
+ : public FullscreenControllerInteractiveTest,
+ public ::testing::WithParamInterface<int> {
+ public:
+ ParamaterizedFullscreenControllerInteractiveTest() {}
+
+ // content::BrowserTestBase:
+ void SetUpCommandLine(base::CommandLine* command_line) override {
+ switch (GetParam()) {
+ case PROMPTING:
+ command_line->AppendSwitchASCII(
+ switches::kDisableFeatures,
+ ExclusiveAccessManager::kSimplifiedUIFeature.name);
+ break;
+ case SIMPLIFIED:
+ command_line->AppendSwitchASCII(
+ switches::kEnableFeatures,
+ ExclusiveAccessManager::kSimplifiedUIFeature.name);
+ break;
+ default:
+ NOTREACHED();
+ }
+ }
+
+ // Whether the test should be prompting the user (i.e. non-simplified UI).
+ bool ShouldPrompt() { return GetParam() == PROMPTING; }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ParamaterizedFullscreenControllerInteractiveTest);
+};
Ilya Sherman 2016/02/24 01:31:19 I'm not sure that any of this is necessary. I thi
+
void FullscreenControllerInteractiveTest::ToggleTabFullscreen(
bool enter_fullscreen) {
ToggleTabFullscreen_Internal(enter_fullscreen, true);
@@ -677,7 +720,7 @@ IN_PROC_BROWSER_TEST_F(FullscreenControllerInteractiveTest,
// Tests mouse lock can be exited and re-entered by an application silently
// with no UI distraction for users.
-IN_PROC_BROWSER_TEST_F(FullscreenControllerInteractiveTest,
+IN_PROC_BROWSER_TEST_P(ParamaterizedFullscreenControllerInteractiveTest,
MAYBE_MouseLockSilentAfterTargetUnlock) {
ASSERT_TRUE(embedded_test_server()->Start());
ui_test_utils::NavigateToURL(
@@ -691,11 +734,13 @@ IN_PROC_BROWSER_TEST_F(FullscreenControllerInteractiveTest,
chrome::NOTIFICATION_MOUSE_LOCK_CHANGED,
content::NotificationService::AllSources()));
ASSERT_TRUE(IsFullscreenBubbleDisplayed());
- ASSERT_TRUE(IsMouseLockPermissionRequested());
- ASSERT_FALSE(IsMouseLocked());
+ if (ShouldPrompt()) {
+ ASSERT_TRUE(IsMouseLockPermissionRequested());
+ ASSERT_FALSE(IsMouseLocked());
- // Accept mouse lock.
- AcceptCurrentFullscreenOrMouseLockRequest();
+ // Accept mouse lock.
+ AcceptCurrentFullscreenOrMouseLockRequest();
+ }
ASSERT_TRUE(IsMouseLocked());
ASSERT_TRUE(IsFullscreenBubbleDisplayed());
@@ -963,3 +1008,8 @@ IN_PROC_BROWSER_TEST_F(FullscreenControllerInteractiveTest,
ASSERT_TRUE(IsFullscreenPermissionRequested());
ASSERT_NO_FATAL_FAILURE(ToggleTabFullscreenNoRetries(false));
}
+
+INSTANTIATE_TEST_CASE_P(
+ ParamaterizedFullscreenControllerInteractiveTestInstance,
+ ParamaterizedFullscreenControllerInteractiveTest,
+ ::testing::Range<int>(TEST_TYPE_START, TEST_TYPE_END));
« no previous file with comments | « no previous file | testing/variations/fieldtrial_testing_config_mac.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698