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 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
570 EXPECT_TRUE(process_map->Contains( | 570 EXPECT_TRUE(process_map->Contains( |
571 contents->GetRenderProcessHost()->GetID())); | 571 contents->GetRenderProcessHost()->GetID())); |
572 bool is_installed = false; | 572 bool is_installed = false; |
573 ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool( | 573 ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool( |
574 contents->GetRenderViewHost(), L"", | 574 contents->GetRenderViewHost(), L"", |
575 L"window.domAutomationController.send(chrome.app.isInstalled)", | 575 L"window.domAutomationController.send(chrome.app.isInstalled)", |
576 &is_installed)); | 576 &is_installed)); |
577 ASSERT_TRUE(is_installed); | 577 ASSERT_TRUE(is_installed); |
578 | 578 |
579 // Crash the tab and reload it, chrome.app.isInstalled should still be true. | 579 // Crash the tab and reload it, chrome.app.isInstalled should still be true. |
580 ui_test_utils::CrashTab(chrome::GetActiveWebContents(browser())); | 580 content::CrashTab(chrome::GetActiveWebContents(browser())); |
581 content::WindowedNotificationObserver observer( | 581 content::WindowedNotificationObserver observer( |
582 content::NOTIFICATION_LOAD_STOP, | 582 content::NOTIFICATION_LOAD_STOP, |
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 |