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 "chrome/browser/extensions/extension_apitest.h" | 5 #include "chrome/browser/extensions/extension_apitest.h" |
6 #include "chrome/browser/extensions/extension_host.h" | 6 #include "chrome/browser/extensions/extension_host.h" |
7 #include "chrome/browser/extensions/extension_service.h" | 7 #include "chrome/browser/extensions/extension_service.h" |
8 #include "chrome/browser/extensions/extension_system.h" | 8 #include "chrome/browser/extensions/extension_system.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 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
605 LoadExtension(test_data_dir_.AppendASCII("app_process")); | 605 LoadExtension(test_data_dir_.AppendASCII("app_process")); |
606 const Extension* launcher = | 606 const Extension* launcher = |
607 LoadExtension(test_data_dir_.AppendASCII("app_launcher")); | 607 LoadExtension(test_data_dir_.AppendASCII("app_launcher")); |
608 | 608 |
609 // There should be three navigations by the time the app page is loaded. | 609 // There should be three navigations by the time the app page is loaded. |
610 // 1. The extension launcher page. | 610 // 1. The extension launcher page. |
611 // 2. The URL that the extension launches, which redirects. | 611 // 2. The URL that the extension launches, which redirects. |
612 // 3. The app's URL. | 612 // 3. The app's URL. |
613 content::TestNavigationObserver test_navigation_observer( | 613 content::TestNavigationObserver test_navigation_observer( |
614 content::NotificationService::AllSources(), | 614 content::NotificationService::AllSources(), |
615 NULL, | |
616 3); | 615 3); |
617 | 616 |
618 // Load the launcher extension, which should launch the app. | 617 // Load the launcher extension, which should launch the app. |
619 ui_test_utils::NavigateToURLWithDisposition( | 618 ui_test_utils::NavigateToURLWithDisposition( |
620 browser(), | 619 browser(), |
621 launcher->GetResourceURL("main.html"), | 620 launcher->GetResourceURL("main.html"), |
622 CURRENT_TAB, | 621 CURRENT_TAB, |
623 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); | 622 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); |
624 | 623 |
625 // Wait for app tab to be created and loaded. | 624 // Wait for app tab to be created and loaded. |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
713 &browser()->tab_strip_model()->GetActiveWebContents()-> | 712 &browser()->tab_strip_model()->GetActiveWebContents()-> |
714 GetController())); | 713 GetController())); |
715 chrome::Reload(browser(), CURRENT_TAB); | 714 chrome::Reload(browser(), CURRENT_TAB); |
716 observer.Wait(); | 715 observer.Wait(); |
717 ASSERT_TRUE(content::ExecuteScriptAndExtractBool( | 716 ASSERT_TRUE(content::ExecuteScriptAndExtractBool( |
718 contents, | 717 contents, |
719 "window.domAutomationController.send(chrome.app.isInstalled)", | 718 "window.domAutomationController.send(chrome.app.isInstalled)", |
720 &is_installed)); | 719 &is_installed)); |
721 ASSERT_TRUE(is_installed); | 720 ASSERT_TRUE(is_installed); |
722 } | 721 } |
OLD | NEW |