| 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_util.h" | 10 #include "base/file_util.h" |
| (...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 550 " window.domAutomationController.send(true);" | 550 " window.domAutomationController.send(true);" |
| 551 "}, false);" | 551 "}, false);" |
| 552 "window.location = '" + url.spec() + "';", | 552 "window.location = '" + url.spec() + "';", |
| 553 &result)); | 553 &result)); |
| 554 ASSERT_TRUE(result); | 554 ASSERT_TRUE(result); |
| 555 windowed_observer.Wait(); | 555 windowed_observer.Wait(); |
| 556 EXPECT_EQ(url, contents->GetController().GetLastCommittedEntry()->GetURL()); | 556 EXPECT_EQ(url, contents->GetController().GetLastCommittedEntry()->GetURL()); |
| 557 } | 557 } |
| 558 | 558 |
| 559 extensions::ExtensionHost* ExtensionBrowserTest::FindHostWithPath( | 559 extensions::ExtensionHost* ExtensionBrowserTest::FindHostWithPath( |
| 560 ExtensionProcessManager* manager, | 560 extensions::ProcessManager* manager, |
| 561 const std::string& path, | 561 const std::string& path, |
| 562 int expected_hosts) { | 562 int expected_hosts) { |
| 563 extensions::ExtensionHost* host = NULL; | 563 extensions::ExtensionHost* host = NULL; |
| 564 int num_hosts = 0; | 564 int num_hosts = 0; |
| 565 ExtensionProcessManager::ExtensionHostSet background_hosts = | 565 extensions::ProcessManager::ExtensionHostSet background_hosts = |
| 566 manager->background_hosts(); | 566 manager->background_hosts(); |
| 567 for (ExtensionProcessManager::const_iterator iter = background_hosts.begin(); | 567 for (extensions::ProcessManager::const_iterator iter = |
| 568 iter != background_hosts.end(); ++iter) { | 568 background_hosts.begin(); |
| 569 iter != background_hosts.end(); |
| 570 ++iter) { |
| 569 if ((*iter)->GetURL().path() == path) { | 571 if ((*iter)->GetURL().path() == path) { |
| 570 EXPECT_FALSE(host); | 572 EXPECT_FALSE(host); |
| 571 host = *iter; | 573 host = *iter; |
| 572 } | 574 } |
| 573 num_hosts++; | 575 num_hosts++; |
| 574 } | 576 } |
| 575 EXPECT_EQ(expected_hosts, num_hosts); | 577 EXPECT_EQ(expected_hosts, num_hosts); |
| 576 return host; | 578 return host; |
| 577 } | 579 } |
| 578 | 580 |
| 579 std::string ExtensionBrowserTest::ExecuteScriptInBackgroundPage( | 581 std::string ExtensionBrowserTest::ExecuteScriptInBackgroundPage( |
| 580 const std::string& extension_id, | 582 const std::string& extension_id, |
| 581 const std::string& script) { | 583 const std::string& script) { |
| 582 return extensions::browsertest_util::ExecuteScriptInBackgroundPage( | 584 return extensions::browsertest_util::ExecuteScriptInBackgroundPage( |
| 583 profile(), extension_id, script); | 585 profile(), extension_id, script); |
| 584 } | 586 } |
| OLD | NEW |