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 11 matching lines...) Expand all Loading... |
22 #include "content/public/browser/notification_service.h" | 22 #include "content/public/browser/notification_service.h" |
23 #include "content/public/browser/render_process_host.h" | 23 #include "content/public/browser/render_process_host.h" |
24 #include "content/public/browser/render_view_host.h" | 24 #include "content/public/browser/render_view_host.h" |
25 #include "content/public/browser/web_contents.h" | 25 #include "content/public/browser/web_contents.h" |
26 #include "content/test/test_navigation_observer.h" | 26 #include "content/test/test_navigation_observer.h" |
27 #include "net/base/mock_host_resolver.h" | 27 #include "net/base/mock_host_resolver.h" |
28 | 28 |
29 using content::NavigationController; | 29 using content::NavigationController; |
30 using content::RenderViewHost; | 30 using content::RenderViewHost; |
31 using content::WebContents; | 31 using content::WebContents; |
| 32 using extensions::Extension; |
32 | 33 |
33 // Simulates a page calling window.open on an URL, and waits for the navigation. | 34 // Simulates a page calling window.open on an URL, and waits for the navigation. |
34 static void WindowOpenHelper(Browser* browser, | 35 static void WindowOpenHelper(Browser* browser, |
35 RenderViewHost* opener_host, | 36 RenderViewHost* opener_host, |
36 const GURL& url, | 37 const GURL& url, |
37 bool newtab_process_should_equal_opener) { | 38 bool newtab_process_should_equal_opener) { |
38 ui_test_utils::WindowedNotificationObserver observer( | 39 ui_test_utils::WindowedNotificationObserver observer( |
39 content::NOTIFICATION_LOAD_STOP, | 40 content::NOTIFICATION_LOAD_STOP, |
40 content::NotificationService::AllSources()); | 41 content::NotificationService::AllSources()); |
41 ASSERT_TRUE(ui_test_utils::ExecuteJavaScript( | 42 ASSERT_TRUE(ui_test_utils::ExecuteJavaScript( |
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
679 &browser()->GetSelectedTabContentsWrapper()->web_contents()-> | 680 &browser()->GetSelectedTabContentsWrapper()->web_contents()-> |
680 GetController())); | 681 GetController())); |
681 browser()->Reload(CURRENT_TAB); | 682 browser()->Reload(CURRENT_TAB); |
682 observer.Wait(); | 683 observer.Wait(); |
683 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( | 684 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( |
684 contents->GetRenderViewHost(), L"", | 685 contents->GetRenderViewHost(), L"", |
685 L"window.domAutomationController.send(chrome.app.isInstalled)", | 686 L"window.domAutomationController.send(chrome.app.isInstalled)", |
686 &is_installed)); | 687 &is_installed)); |
687 ASSERT_TRUE(is_installed); | 688 ASSERT_TRUE(is_installed); |
688 } | 689 } |
OLD | NEW |