Revert of Add button to add new FSP services to Files app. (patchset #8 id:140001...
[chromium-blink-merge.git] / chrome / browser / ui / views / frame / browser_view_interactive_uitest.cc
blob6b41ea722ae0571da7adee3e1513749046c7723a
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 #include "chrome/browser/ui/views/frame/browser_view.h"
7 #include "chrome/app/chrome_command_ids.h"
8 #include "chrome/browser/autocomplete/autocomplete_controller.h"
9 #include "chrome/browser/search/search.h"
10 #include "chrome/browser/ui/browser_commands.h"
11 #include "chrome/browser/ui/omnibox/omnibox_view.h"
12 #include "chrome/browser/ui/search/instant_test_utils.h"
13 #include "chrome/browser/ui/tabs/tab_strip_model.h"
14 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h"
15 #include "chrome/browser/ui/views/frame/immersive_mode_controller.h"
16 #include "chrome/browser/ui/views/frame/top_container_view.h"
17 #include "chrome/browser/ui/views/location_bar/location_bar_view.h"
18 #include "chrome/browser/ui/views/tabs/tab.h"
19 #include "chrome/browser/ui/views/toolbar/toolbar_view.h"
20 #include "chrome/common/instant_types.h"
21 #include "chrome/common/url_constants.h"
22 #include "chrome/test/base/in_process_browser_test.h"
23 #include "ui/views/controls/webview/webview.h"
24 #include "ui/views/focus/focus_manager.h"
25 #include "ui/views/window/non_client_view.h"
27 #if defined(OS_CHROMEOS)
28 #include "chrome/browser/chrome_notification_types.h"
29 #include "content/public/browser/notification_service.h"
30 #include "ui/compositor/layer.h"
31 #include "ui/compositor/scoped_animation_duration_scale_mode.h"
32 #endif
34 using views::FocusManager;
36 typedef InProcessBrowserTest BrowserViewTest;
38 // Active window and focus testing is not reliable on Windows crbug.com/79493
39 // TODO(linux_aura) http://crbug.com/163931
40 #if defined(OS_WIN) || (defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(USE_AURA))
41 #define MAYBE_FullscreenClearsFocus DISABLED_FullscreenClearsFocus
42 #else
43 #define MAYBE_FullscreenClearsFocus FullscreenClearsFocus
44 #endif
45 IN_PROC_BROWSER_TEST_F(BrowserViewTest, MAYBE_FullscreenClearsFocus) {
46 BrowserView* browser_view = static_cast<BrowserView*>(browser()->window());
47 LocationBarView* location_bar_view = browser_view->GetLocationBarView();
48 FocusManager* focus_manager = browser_view->GetFocusManager();
50 // Focus starts in the location bar or one of its children.
51 EXPECT_TRUE(location_bar_view->Contains(focus_manager->GetFocusedView()));
53 chrome::ToggleFullscreenMode(browser());
54 EXPECT_TRUE(browser_view->IsFullscreen());
56 // Focus is released from the location bar.
57 EXPECT_FALSE(location_bar_view->Contains(focus_manager->GetFocusedView()));