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/process_map.h" | 8 #include "chrome/browser/extensions/process_map.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 | 488 |
489 // Load the launcher extension, which should launch the app. | 489 // Load the launcher extension, which should launch the app. |
490 ui_test_utils::NavigateToURLWithDisposition( | 490 ui_test_utils::NavigateToURLWithDisposition( |
491 browser(), | 491 browser(), |
492 launcher->GetResourceURL("main.html"), | 492 launcher->GetResourceURL("main.html"), |
493 CURRENT_TAB, | 493 CURRENT_TAB, |
494 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); | 494 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); |
495 | 495 |
496 // Wait for app tab to be created and loaded. | 496 // Wait for app tab to be created and loaded. |
497 test_navigation_observer.WaitForObservation( | 497 test_navigation_observer.WaitForObservation( |
498 base::Bind(&ui_test_utils::RunMessageLoop), | 498 base::Bind(&content::RunMessageLoop), |
499 base::Bind(&MessageLoop::Quit, | 499 base::Bind(&MessageLoop::Quit, |
500 base::Unretained(MessageLoopForUI::current()))); | 500 base::Unretained(MessageLoopForUI::current()))); |
501 | 501 |
502 // App has loaded, and chrome.app.isInstalled should be true. | 502 // App has loaded, and chrome.app.isInstalled should be true. |
503 bool is_installed = false; | 503 bool is_installed = false; |
504 ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool( | 504 ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool( |
505 chrome::GetActiveWebContents(browser())->GetRenderViewHost(), L"", | 505 chrome::GetActiveWebContents(browser())->GetRenderViewHost(), L"", |
506 L"window.domAutomationController.send(chrome.app.isInstalled)", | 506 L"window.domAutomationController.send(chrome.app.isInstalled)", |
507 &is_installed)); | 507 &is_installed)); |
508 ASSERT_TRUE(is_installed); | 508 ASSERT_TRUE(is_installed); |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
583 content::Source<NavigationController>( | 583 content::Source<NavigationController>( |
584 &chrome::GetActiveWebContents(browser())->GetController())); | 584 &chrome::GetActiveWebContents(browser())->GetController())); |
585 chrome::Reload(browser(), CURRENT_TAB); | 585 chrome::Reload(browser(), CURRENT_TAB); |
586 observer.Wait(); | 586 observer.Wait(); |
587 ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool( | 587 ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool( |
588 contents->GetRenderViewHost(), L"", | 588 contents->GetRenderViewHost(), L"", |
589 L"window.domAutomationController.send(chrome.app.isInstalled)", | 589 L"window.domAutomationController.send(chrome.app.isInstalled)", |
590 &is_installed)); | 590 &is_installed)); |
591 ASSERT_TRUE(is_installed); | 591 ASSERT_TRUE(is_installed); |
592 } | 592 } |
OLD | NEW |