This source file includes following definitions.
- IN_PROC_BROWSER_TEST_F
- IN_PROC_BROWSER_TEST_F
#include "base/compiler_specific.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/fullscreen/fullscreen_controller.h"
#include "chrome/browser/ui/fullscreen/fullscreen_controller_test.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/test/base/ui_test_utils.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/url_constants.h"
#include "content/public/test/test_navigation_observer.h"
#if defined(OS_MACOSX)
#include "base/mac/mac_util.h"
#endif
using content::kAboutBlankURL;
using content::WebContents;
using content::PAGE_TRANSITION_TYPED;
class FullscreenControllerBrowserTest: public FullscreenControllerTest {
};
IN_PROC_BROWSER_TEST_F(FullscreenControllerTest,
PendingMouseLockExitsOnTabSwitch) {
AddTabAtIndex(0, GURL(kAboutBlankURL), PAGE_TRANSITION_TYPED);
AddTabAtIndex(0, GURL(kAboutBlankURL), PAGE_TRANSITION_TYPED);
WebContents* tab1 = browser()->tab_strip_model()->GetActiveWebContents();
RequestToLockMouse(true, false);
ASSERT_TRUE(IsFullscreenBubbleDisplayed());
browser()->tab_strip_model()->ActivateTabAt(0, true);
ASSERT_TRUE(IsFullscreenBubbleDisplayed());
{
MouseLockNotificationObserver mouse_lock_observer;
browser()->tab_strip_model()->ActivateTabAt(1, true);
mouse_lock_observer.Wait();
}
ASSERT_FALSE(IsFullscreenBubbleDisplayed());
RequestToLockMouse(true, false);
ASSERT_TRUE(IsFullscreenBubbleDisplayed());
chrome::CloseWebContents(browser(), tab1, false);
ASSERT_TRUE(IsFullscreenBubbleDisplayed());
}
IN_PROC_BROWSER_TEST_F(FullscreenControllerTest,
PendingMouseLockExitsOnTabClose) {
AddTabAtIndex(0, GURL(kAboutBlankURL), PAGE_TRANSITION_TYPED);
AddTabAtIndex(0, GURL(kAboutBlankURL), PAGE_TRANSITION_TYPED);
RequestToLockMouse(true, false);
ASSERT_TRUE(IsFullscreenBubbleDisplayed());
{
MouseLockNotificationObserver mouse_lock_observer;
chrome::CloseTab(browser());
mouse_lock_observer.Wait();
}
ASSERT_FALSE(IsFullscreenBubbleDisplayed());
}