| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "apps/launcher.h" | 5 #include "apps/launcher.h" |
| 6 #include "base/bind.h" | 6 #include "base/bind.h" |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 805 const char* name, int test_flags) { | 805 const char* name, int test_flags) { |
| 806 using content::DevToolsAgentHost; | 806 using content::DevToolsAgentHost; |
| 807 const Extension* extension = LoadAndLaunchPlatformApp(name, "Launched"); | 807 const Extension* extension = LoadAndLaunchPlatformApp(name, "Launched"); |
| 808 ASSERT_TRUE(extension); | 808 ASSERT_TRUE(extension); |
| 809 AppWindow* window = GetFirstAppWindow(); | 809 AppWindow* window = GetFirstAppWindow(); |
| 810 ASSERT_TRUE(window); | 810 ASSERT_TRUE(window); |
| 811 ASSERT_EQ(window->window_key().empty(), (test_flags & HAS_ID) == 0); | 811 ASSERT_EQ(window->window_key().empty(), (test_flags & HAS_ID) == 0); |
| 812 content::WebContents* web_contents = window->web_contents(); | 812 content::WebContents* web_contents = window->web_contents(); |
| 813 ASSERT_TRUE(web_contents); | 813 ASSERT_TRUE(web_contents); |
| 814 | 814 |
| 815 // Ensure no DevTools open for the AppWindow, then open one. | 815 OpenDevToolsWindow(web_contents); |
| 816 ASSERT_FALSE(DevToolsAgentHost::HasFor(web_contents)); | |
| 817 DevToolsWindow::OpenDevToolsWindow(web_contents); | |
| 818 ASSERT_TRUE(DevToolsAgentHost::HasFor(web_contents)); | |
| 819 | 816 |
| 820 if (test_flags & RELAUNCH) { | 817 if (test_flags & RELAUNCH) { |
| 821 // Close the AppWindow, and ensure it is gone. | 818 // Close the AppWindow, and ensure it is gone. |
| 822 CloseAppWindow(window); | 819 CloseAppWindow(window); |
| 823 ASSERT_FALSE(GetFirstAppWindow()); | 820 ASSERT_FALSE(GetFirstAppWindow()); |
| 824 | 821 |
| 825 // Relaunch the app and get a new AppWindow. | 822 // Relaunch the app and get a new AppWindow. |
| 826 content::WindowedNotificationObserver app_loaded_observer( | 823 content::WindowedNotificationObserver app_loaded_observer( |
| 827 content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, | 824 content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, |
| 828 content::NotificationService::AllSources()); | 825 content::NotificationService::AllSources()); |
| (...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1337 // Now check that the app window's default zoom, and actual zoom level, | 1334 // Now check that the app window's default zoom, and actual zoom level, |
| 1338 // have not been changed from the default. | 1335 // have not been changed from the default. |
| 1339 WebContents* web_contents = GetFirstAppWindowWebContents(); | 1336 WebContents* web_contents = GetFirstAppWindowWebContents(); |
| 1340 content::HostZoomMap* app_host_zoom_map = content::HostZoomMap::Get( | 1337 content::HostZoomMap* app_host_zoom_map = content::HostZoomMap::Get( |
| 1341 web_contents->GetSiteInstance()); | 1338 web_contents->GetSiteInstance()); |
| 1342 EXPECT_EQ(0, app_host_zoom_map->GetDefaultZoomLevel()); | 1339 EXPECT_EQ(0, app_host_zoom_map->GetDefaultZoomLevel()); |
| 1343 EXPECT_EQ(0, app_host_zoom_map->GetZoomLevel(web_contents)); | 1340 EXPECT_EQ(0, app_host_zoom_map->GetZoomLevel(web_contents)); |
| 1344 } | 1341 } |
| 1345 | 1342 |
| 1346 } // namespace extensions | 1343 } // namespace extensions |
| OLD | NEW |