1 // Copyright 2013 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 #import "chrome/browser/ui/cocoa/dev_tools_controller.h"
7 #include "chrome/browser/devtools/devtools_window.h"
8 #include "chrome/browser/ui/browser.h"
9 #include "chrome/browser/ui/browser_list.h"
10 #include "chrome/browser/ui/browser_window.h"
11 #include "chrome/browser/ui/cocoa/browser_window_controller.h"
12 #include "chrome/browser/ui/find_bar/find_bar.h"
13 #include "chrome/browser/ui/find_bar/find_bar_controller.h"
14 #include "chrome/common/url_constants.h"
15 #include "chrome/test/base/in_process_browser_test.h"
16 #include "content/public/browser/web_contents.h"
17 #include "content/public/browser/web_contents_view.h"
19 class DevToolsControllerTest : public InProcessBrowserTest {
21 DevToolsControllerTest() : InProcessBrowserTest() {
24 virtual void SetUpOnMainThread() OVERRIDE {
25 DevToolsWindow::OpenDevToolsWindowForTest(browser(), true);
29 DISALLOW_COPY_AND_ASSIGN(DevToolsControllerTest);
32 // Verify that AllowOverlappingViews is set while the find bar is visible.
33 IN_PROC_BROWSER_TEST_F(DevToolsControllerTest, AllowOverlappingViews) {
34 content::WebContents* web_contents =
35 browser()->tab_strip_model()->GetActiveWebContents();
36 DevToolsWindow* dev_tools =
37 DevToolsWindow::GetDockedInstanceForInspectedTab(web_contents);
38 content::WebContentsView* dev_tools_view =
39 dev_tools->web_contents()->GetView();
41 // Without the find bar.
42 EXPECT_TRUE(dev_tools_view->GetAllowOverlappingViews());
45 browser()->GetFindBarController()->find_bar()->Show(false);
46 EXPECT_TRUE(dev_tools_view->GetAllowOverlappingViews());
48 // Without the find bar.
49 browser()->GetFindBarController()->find_bar()->Hide(false);
50 EXPECT_TRUE(dev_tools_view->GetAllowOverlappingViews());