| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 // extension views to load, since we only register views after observing | 508 // extension views to load, since we only register views after observing |
| 509 // extension load. | 509 // extension load. |
| 510 base::RunLoop().RunUntilIdle(); | 510 base::RunLoop().RunUntilIdle(); |
| 511 observer_->WaitForExtensionViewsToLoad(); | 511 observer_->WaitForExtensionViewsToLoad(); |
| 512 } | 512 } |
| 513 | 513 |
| 514 void ExtensionBrowserTest::UnloadExtension(const std::string& extension_id) { | 514 void ExtensionBrowserTest::UnloadExtension(const std::string& extension_id) { |
| 515 ExtensionService* service = extensions::ExtensionSystem::Get( | 515 ExtensionService* service = extensions::ExtensionSystem::Get( |
| 516 profile())->extension_service(); | 516 profile())->extension_service(); |
| 517 service->UnloadExtension(extension_id, | 517 service->UnloadExtension(extension_id, |
| 518 extensions::UnloadedExtensionInfo::REASON_DISABLE); | 518 extensions::UnloadedExtensionReason::REASON_DISABLE); |
| 519 } | 519 } |
| 520 | 520 |
| 521 void ExtensionBrowserTest::UninstallExtension(const std::string& extension_id) { | 521 void ExtensionBrowserTest::UninstallExtension(const std::string& extension_id) { |
| 522 ExtensionService* service = extensions::ExtensionSystem::Get( | 522 ExtensionService* service = extensions::ExtensionSystem::Get( |
| 523 profile())->extension_service(); | 523 profile())->extension_service(); |
| 524 service->UninstallExtension(extension_id, | 524 service->UninstallExtension(extension_id, |
| 525 extensions::UNINSTALL_REASON_FOR_TESTING, | 525 extensions::UNINSTALL_REASON_FOR_TESTING, |
| 526 base::Bind(&base::DoNothing), | 526 base::Bind(&base::DoNothing), |
| 527 NULL); | 527 NULL); |
| 528 } | 528 } |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 612 return extensions::browsertest_util::ExecuteScriptInBackgroundPage( | 612 return extensions::browsertest_util::ExecuteScriptInBackgroundPage( |
| 613 profile(), extension_id, script); | 613 profile(), extension_id, script); |
| 614 } | 614 } |
| 615 | 615 |
| 616 bool ExtensionBrowserTest::ExecuteScriptInBackgroundPageNoWait( | 616 bool ExtensionBrowserTest::ExecuteScriptInBackgroundPageNoWait( |
| 617 const std::string& extension_id, | 617 const std::string& extension_id, |
| 618 const std::string& script) { | 618 const std::string& script) { |
| 619 return extensions::browsertest_util::ExecuteScriptInBackgroundPageNoWait( | 619 return extensions::browsertest_util::ExecuteScriptInBackgroundPageNoWait( |
| 620 profile(), extension_id, script); | 620 profile(), extension_id, script); |
| 621 } | 621 } |
| OLD | NEW |