| 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 <set> | 5 #include <set> |
| 6 #include <string> | 6 #include <string> |
| 7 | 7 |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 } | 78 } |
| 79 | 79 |
| 80 bool OnExternalExtensionUpdateUrlFound( | 80 bool OnExternalExtensionUpdateUrlFound( |
| 81 const extensions::ExternalInstallInfoUpdateUrl& info, | 81 const extensions::ExternalInstallInfoUpdateUrl& info, |
| 82 bool is_initial_load) override { | 82 bool is_initial_load) override { |
| 83 // Extension has the correct location. | 83 // Extension has the correct location. |
| 84 EXPECT_EQ(Manifest::EXTERNAL_POLICY_DOWNLOAD, info.download_location); | 84 EXPECT_EQ(Manifest::EXTERNAL_POLICY_DOWNLOAD, info.download_location); |
| 85 | 85 |
| 86 // Provider returns the correct location when asked. | 86 // Provider returns the correct location when asked. |
| 87 Manifest::Location location1; | 87 Manifest::Location location1; |
| 88 std::unique_ptr<Version> version1; | 88 std::unique_ptr<base::Version> version1; |
| 89 provider_->GetExtensionDetails(info.extension_id, &location1, &version1); | 89 provider_->GetExtensionDetails(info.extension_id, &location1, &version1); |
| 90 EXPECT_EQ(Manifest::EXTERNAL_POLICY_DOWNLOAD, location1); | 90 EXPECT_EQ(Manifest::EXTERNAL_POLICY_DOWNLOAD, location1); |
| 91 EXPECT_FALSE(version1.get()); | 91 EXPECT_FALSE(version1.get()); |
| 92 | 92 |
| 93 // Remove the extension from our list. | 93 // Remove the extension from our list. |
| 94 EXPECT_EQ(1U, expected_extensions_.erase(info.extension_id)); | 94 EXPECT_EQ(1U, expected_extensions_.erase(info.extension_id)); |
| 95 return true; | 95 return true; |
| 96 } | 96 } |
| 97 | 97 |
| 98 void OnExternalProviderReady( | 98 void OnExternalProviderReady( |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 forced_extensions.SetString("invalid", "http://www.example.com/crx"); | 148 forced_extensions.SetString("invalid", "http://www.example.com/crx"); |
| 149 forced_extensions.SetString("dddddddddddddddddddddddddddddddd", | 149 forced_extensions.SetString("dddddddddddddddddddddddddddddddd", |
| 150 std::string()); | 150 std::string()); |
| 151 forced_extensions.SetString("invalid", "bad"); | 151 forced_extensions.SetString("invalid", "bad"); |
| 152 | 152 |
| 153 MockExternalPolicyProviderVisitor mv; | 153 MockExternalPolicyProviderVisitor mv; |
| 154 mv.Visit(forced_extensions, expected_extensions); | 154 mv.Visit(forced_extensions, expected_extensions); |
| 155 } | 155 } |
| 156 | 156 |
| 157 } // namespace extensions | 157 } // namespace extensions |
| OLD | NEW |