| 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/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 VLOG(1) << *iter; | 562 VLOG(1) << *iter; |
| 563 | 563 |
| 564 return NULL; | 564 return NULL; |
| 565 } | 565 } |
| 566 | 566 |
| 567 if (!observer_->WaitForExtensionViewsToLoad()) | 567 if (!observer_->WaitForExtensionViewsToLoad()) |
| 568 return NULL; | 568 return NULL; |
| 569 return service->GetExtensionById(last_loaded_extension_id(), false); | 569 return service->GetExtensionById(last_loaded_extension_id(), false); |
| 570 } | 570 } |
| 571 | 571 |
| 572 void ExtensionBrowserTest::ReloadExtension(const std::string extension_id) { | 572 void ExtensionBrowserTest::ReloadExtension(const std::string& extension_id) { |
| 573 observer_->Watch(extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED, | 573 observer_->Watch(extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED, |
| 574 content::NotificationService::AllSources()); | 574 content::NotificationService::AllSources()); |
| 575 | 575 |
| 576 ExtensionService* service = | 576 ExtensionService* service = |
| 577 extensions::ExtensionSystem::Get(profile())->extension_service(); | 577 extensions::ExtensionSystem::Get(profile())->extension_service(); |
| 578 service->ReloadExtension(extension_id); | 578 service->ReloadExtension(extension_id); |
| 579 | 579 |
| 580 observer_->Wait(); | 580 observer_->Wait(); |
| 581 observer_->WaitForExtensionViewsToLoad(); | 581 observer_->WaitForExtensionViewsToLoad(); |
| 582 } | 582 } |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 682 return extensions::browsertest_util::ExecuteScriptInBackgroundPage( | 682 return extensions::browsertest_util::ExecuteScriptInBackgroundPage( |
| 683 profile(), extension_id, script); | 683 profile(), extension_id, script); |
| 684 } | 684 } |
| 685 | 685 |
| 686 bool ExtensionBrowserTest::ExecuteScriptInBackgroundPageNoWait( | 686 bool ExtensionBrowserTest::ExecuteScriptInBackgroundPageNoWait( |
| 687 const std::string& extension_id, | 687 const std::string& extension_id, |
| 688 const std::string& script) { | 688 const std::string& script) { |
| 689 return extensions::browsertest_util::ExecuteScriptInBackgroundPageNoWait( | 689 return extensions::browsertest_util::ExecuteScriptInBackgroundPageNoWait( |
| 690 profile(), extension_id, script); | 690 profile(), extension_id, script); |
| 691 } | 691 } |
| OLD | NEW |