OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 "base/utf_string_conversions.h" | 5 #include "base/utf_string_conversions.h" |
6 #include "chrome/browser/extensions/extension_apitest.h" | 6 #include "chrome/browser/extensions/extension_apitest.h" |
7 #include "chrome/browser/extensions/extension_host.h" | 7 #include "chrome/browser/extensions/extension_host.h" |
8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
9 #include "chrome/browser/extensions/process_map.h" | 9 #include "chrome/browser/extensions/process_map.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 #include "content/public/browser/notification_service.h" | 23 #include "content/public/browser/notification_service.h" |
24 #include "content/public/browser/render_process_host.h" | 24 #include "content/public/browser/render_process_host.h" |
25 #include "content/public/browser/render_view_host.h" | 25 #include "content/public/browser/render_view_host.h" |
26 #include "content/public/browser/web_contents.h" | 26 #include "content/public/browser/web_contents.h" |
27 #include "content/test/test_navigation_observer.h" | 27 #include "content/test/test_navigation_observer.h" |
28 #include "net/base/mock_host_resolver.h" | 28 #include "net/base/mock_host_resolver.h" |
29 | 29 |
30 using content::NavigationController; | 30 using content::NavigationController; |
31 using content::RenderViewHost; | 31 using content::RenderViewHost; |
32 using content::WebContents; | 32 using content::WebContents; |
| 33 using extensions::Extension; |
33 | 34 |
34 // Simulates a page calling window.open on an URL, and waits for the navigation. | 35 // Simulates a page calling window.open on an URL, and waits for the navigation. |
35 static void WindowOpenHelper(Browser* browser, | 36 static void WindowOpenHelper(Browser* browser, |
36 RenderViewHost* opener_host, | 37 RenderViewHost* opener_host, |
37 const GURL& url, | 38 const GURL& url, |
38 bool newtab_process_should_equal_opener) { | 39 bool newtab_process_should_equal_opener) { |
39 ui_test_utils::WindowedNotificationObserver observer( | 40 ui_test_utils::WindowedNotificationObserver observer( |
40 content::NOTIFICATION_LOAD_STOP, | 41 content::NOTIFICATION_LOAD_STOP, |
41 content::NotificationService::AllSources()); | 42 content::NotificationService::AllSources()); |
42 ASSERT_TRUE(ui_test_utils::ExecuteJavaScript( | 43 ASSERT_TRUE(ui_test_utils::ExecuteJavaScript( |
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
710 &browser()->GetSelectedTabContentsWrapper()->web_contents()-> | 711 &browser()->GetSelectedTabContentsWrapper()->web_contents()-> |
711 GetController())); | 712 GetController())); |
712 browser()->Reload(CURRENT_TAB); | 713 browser()->Reload(CURRENT_TAB); |
713 observer.Wait(); | 714 observer.Wait(); |
714 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( | 715 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( |
715 contents->GetRenderViewHost(), L"", | 716 contents->GetRenderViewHost(), L"", |
716 L"window.domAutomationController.send(chrome.app.isInstalled)", | 717 L"window.domAutomationController.send(chrome.app.isInstalled)", |
717 &is_installed)); | 718 &is_installed)); |
718 ASSERT_TRUE(is_installed); | 719 ASSERT_TRUE(is_installed); |
719 } | 720 } |
OLD | NEW |