| 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_browsertest.h" | 5 #include "chrome/browser/extensions/extension_browsertest.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 582 content::NotificationService::AllSources()); | 582 content::NotificationService::AllSources()); |
| 583 ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool( | 583 ASSERT_TRUE(content::ExecuteJavaScriptAndExtractBool( |
| 584 contents->GetRenderViewHost(), L"", | 584 contents->GetRenderViewHost(), L"", |
| 585 L"window.addEventListener('unload', function() {" | 585 L"window.addEventListener('unload', function() {" |
| 586 L" window.domAutomationController.send(true);" | 586 L" window.domAutomationController.send(true);" |
| 587 L"}, false);" | 587 L"}, false);" |
| 588 L"window.location = '" + UTF8ToWide(url.spec()) + L"';", | 588 L"window.location = '" + UTF8ToWide(url.spec()) + L"';", |
| 589 &result)); | 589 &result)); |
| 590 ASSERT_TRUE(result); | 590 ASSERT_TRUE(result); |
| 591 observer.Wait(); | 591 observer.Wait(); |
| 592 EXPECT_EQ(&contents->GetController(), |
| 593 content::Source<content::NavigationController>(observer.source() |
| 594 ).ptr()); |
| 592 EXPECT_EQ(url, contents->GetController().GetLastCommittedEntry()->GetURL()); | 595 EXPECT_EQ(url, contents->GetController().GetLastCommittedEntry()->GetURL()); |
| 593 } | 596 } |
| 594 | 597 |
| 595 extensions::ExtensionHost* ExtensionBrowserTest::FindHostWithPath( | 598 extensions::ExtensionHost* ExtensionBrowserTest::FindHostWithPath( |
| 596 ExtensionProcessManager* manager, | 599 ExtensionProcessManager* manager, |
| 597 const std::string& path, | 600 const std::string& path, |
| 598 int expected_hosts) { | 601 int expected_hosts) { |
| 599 extensions::ExtensionHost* host = NULL; | 602 extensions::ExtensionHost* host = NULL; |
| 600 int num_hosts = 0; | 603 int num_hosts = 0; |
| 601 ExtensionProcessManager::ExtensionHostSet background_hosts = | 604 ExtensionProcessManager::ExtensionHostSet background_hosts = |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 690 case content::NOTIFICATION_LOAD_STOP: | 693 case content::NOTIFICATION_LOAD_STOP: |
| 691 VLOG(1) << "Got LOAD_STOP notification."; | 694 VLOG(1) << "Got LOAD_STOP notification."; |
| 692 MessageLoopForUI::current()->Quit(); | 695 MessageLoopForUI::current()->Quit(); |
| 693 break; | 696 break; |
| 694 | 697 |
| 695 default: | 698 default: |
| 696 NOTREACHED(); | 699 NOTREACHED(); |
| 697 break; | 700 break; |
| 698 } | 701 } |
| 699 } | 702 } |
| OLD | NEW |