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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "chrome/browser/extensions/extension_browsertest.h" | 9 #include "chrome/browser/extensions/extension_browsertest.h" |
10 #include "chrome/browser/extensions/extension_host.h" | 10 #include "chrome/browser/extensions/extension_host.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 ExtensionProcessManager* manager = | 48 ExtensionProcessManager* manager = |
49 extensions::ExtensionSystem::Get(browser()->profile())-> | 49 extensions::ExtensionSystem::Get(browser()->profile())-> |
50 process_manager(); | 50 process_manager(); |
51 extensions::ExtensionHost* ext_host = | 51 extensions::ExtensionHost* ext_host = |
52 manager->GetBackgroundHostForExtension(extension->id()); | 52 manager->GetBackgroundHostForExtension(extension->id()); |
53 EXPECT_TRUE(ext_host); | 53 EXPECT_TRUE(ext_host); |
54 if (!ext_host) | 54 if (!ext_host) |
55 return false; | 55 return false; |
56 | 56 |
57 std::string version_from_bg; | 57 std::string version_from_bg; |
58 bool exec = content::ExecuteJavaScriptAndExtractString( | 58 bool exec = content::ExecuteScriptAndExtractString( |
59 ext_host->render_view_host(), "", "version()", &version_from_bg); | 59 ext_host->render_view_host(), "version()", &version_from_bg); |
60 EXPECT_TRUE(exec); | 60 EXPECT_TRUE(exec); |
61 if (!exec) | 61 if (!exec) |
62 return false; | 62 return false; |
63 | 63 |
64 if (version_from_bg != expected_version || | 64 if (version_from_bg != expected_version || |
65 extension->VersionString() != expected_version) | 65 extension->VersionString() != expected_version) |
66 return false; | 66 return false; |
67 return true; | 67 return true; |
68 } | 68 } |
69 }; | 69 }; |
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 forcelist, kExtensionId, "http://localhost/autoupdate/manifest"); | 642 forcelist, kExtensionId, "http://localhost/autoupdate/manifest"); |
643 } | 643 } |
644 ASSERT_TRUE(WaitForExtensionInstall()); | 644 ASSERT_TRUE(WaitForExtensionInstall()); |
645 ASSERT_EQ(size_before + 1, service->extensions()->size()); | 645 ASSERT_EQ(size_before + 1, service->extensions()->size()); |
646 extension = service->GetExtensionById(kExtensionId, false); | 646 extension = service->GetExtensionById(kExtensionId, false); |
647 ASSERT_TRUE(extension); | 647 ASSERT_TRUE(extension); |
648 EXPECT_EQ(Extension::EXTERNAL_POLICY_DOWNLOAD, extension->location()); | 648 EXPECT_EQ(Extension::EXTERNAL_POLICY_DOWNLOAD, extension->location()); |
649 EXPECT_TRUE(service->IsExtensionEnabled(kExtensionId)); | 649 EXPECT_TRUE(service->IsExtensionEnabled(kExtensionId)); |
650 EXPECT_TRUE(service->disabled_extensions()->is_empty()); | 650 EXPECT_TRUE(service->disabled_extensions()->is_empty()); |
651 } | 651 } |
OLD | NEW |