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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_FULLSCREEN_FULLSCREEN_CONTROLLER_TEST_H_
6 #define CHROME_BROWSER_UI_FULLSCREEN_FULLSCREEN_CONTROLLER_TEST_H_
8 #include "chrome/browser/chrome_notification_types.h"
9 #include "chrome/browser/ui/fullscreen/fullscreen_exit_bubble_type.h"
10 #include "chrome/test/base/in_process_browser_test.h"
11 #include "content/public/browser/notification_service.h"
12 #include "content/public/test/test_utils.h"
14 // Observer for NOTIFICATION_FULLSCREEN_CHANGED notifications.
15 class FullscreenNotificationObserver
16 : public content::WindowedNotificationObserver
{
18 FullscreenNotificationObserver() : WindowedNotificationObserver(
19 chrome::NOTIFICATION_FULLSCREEN_CHANGED
,
20 content::NotificationService::AllSources()) {}
22 DISALLOW_COPY_AND_ASSIGN(FullscreenNotificationObserver
);
25 // Observer for NOTIFICATION_MOUSE_LOCK_CHANGED notifications.
26 class MouseLockNotificationObserver
27 : public content::WindowedNotificationObserver
{
29 MouseLockNotificationObserver() : WindowedNotificationObserver(
30 chrome::NOTIFICATION_MOUSE_LOCK_CHANGED
,
31 content::NotificationService::AllSources()) {}
33 DISALLOW_COPY_AND_ASSIGN(MouseLockNotificationObserver
);
36 // Test fixture with convenience functions for fullscreen and mouse lock.
37 class FullscreenControllerTest
: public InProcessBrowserTest
{
39 FullscreenControllerTest() {}
41 void RequestToLockMouse(bool user_gesture
,
42 bool last_unlocked_by_target
);
44 bool SendEscapeToFullscreenController();
45 bool IsFullscreenForBrowser();
46 bool IsFullscreenForTabOrPending();
47 bool IsMouseLockPermissionRequested();
48 bool IsFullscreenPermissionRequested();
49 FullscreenExitBubbleType
GetFullscreenExitBubbleType();
50 bool IsFullscreenBubbleDisplayed();
51 bool IsFullscreenBubbleDisplayingButtons();
52 void AcceptCurrentFullscreenOrMouseLockRequest();
53 void DenyCurrentFullscreenOrMouseLockRequest();
56 void SetPrivilegedFullscreen(bool is_privileged
);
57 static const char kFullscreenMouseLockHTML
[];
59 void ToggleTabFullscreen_Internal(bool enter_fullscreen
,
60 bool retry_until_success
);
61 DISALLOW_COPY_AND_ASSIGN(FullscreenControllerTest
);
64 #endif // CHROME_BROWSER_UI_FULLSCREEN_FULLSCREEN_CONTROLLER_TEST_H_