// found in the LICENSE file.
#include "chrome/browser/apps/app_browsertest_util.h"
-#include "chrome/browser/extensions/extension_test_message_listener.h"
#include "chrome/browser/profiles/profile.h"
-#include "chrome/common/chrome_switches.h"
-#include "content/public/browser/web_contents_view.h"
#include "content/public/test/browser_test_utils.h"
#include "extensions/browser/process_manager.h"
+#include "extensions/common/switches.h"
+#include "extensions/test/extension_test_message_listener.h"
class WindowControlsTest : public extensions::PlatformAppBrowserTest {
protected:
- virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
+ void SetUpCommandLine(CommandLine* command_line) override {
extensions::PlatformAppBrowserTest::SetUpCommandLine(command_line);
- command_line->AppendSwitch(switches::kEnableAppWindowControls);
+ command_line->AppendSwitch(extensions::switches::kEnableAppWindowControls);
}
content::WebContents* GetWebContentsForExtensionWindow(
const extensions::Extension* extension);
content::WebContents* WindowControlsTest::GetWebContentsForExtensionWindow(
const extensions::Extension* extension) {
extensions::ProcessManager* process_manager =
- extensions::ExtensionSystem::Get(profile())->process_manager();
+ extensions::ProcessManager::Get(profile());
// Lookup render view host for background page.
const extensions::ExtensionHost* extension_host =
IN_PROC_BROWSER_TEST_F(WindowControlsTest, CloseControlWorks) {
// Launch app and wait for window to show up
- ExtensionTestMessageListener window_opened("window-opened", false);
const extensions::Extension* extension =
- LoadAndLaunchPlatformApp("window_controls/buttons");
- ASSERT_TRUE(window_opened.WaitUntilSatisfied());
+ LoadAndLaunchPlatformApp("window_controls/buttons", "window-opened");
// Find WebContents of window
content::WebContents* web_contents =
// Send mouse click somewhere inside the [x] button
const int controlOffset = 25;
- int x = web_contents->GetView()->GetContainerSize().width() - controlOffset;
+ int x = web_contents->GetContainerBounds().size().width() - controlOffset;
int y = controlOffset;
content::SimulateMouseClickAt(web_contents,
0,