| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "base/version.h" | 10 #include "base/version.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 | 78 |
| 79 // Provider returns the correct location when asked. | 79 // Provider returns the correct location when asked. |
| 80 Extension::Location location1; | 80 Extension::Location location1; |
| 81 scoped_ptr<Version> version1; | 81 scoped_ptr<Version> version1; |
| 82 provider_->GetExtensionDetails(id, &location1, &version1); | 82 provider_->GetExtensionDetails(id, &location1, &version1); |
| 83 EXPECT_EQ(Extension::EXTERNAL_POLICY_DOWNLOAD, location1); | 83 EXPECT_EQ(Extension::EXTERNAL_POLICY_DOWNLOAD, location1); |
| 84 EXPECT_FALSE(version1.get()); | 84 EXPECT_FALSE(version1.get()); |
| 85 | 85 |
| 86 // Remove the extension from our list. | 86 // Remove the extension from our list. |
| 87 StringValue ext_str(id + ";" + update_url.spec()); | 87 StringValue ext_str(id + ";" + update_url.spec()); |
| 88 EXPECT_NE(-1, remaining_extensions->Remove(ext_str)); | 88 EXPECT_NE(false, remaining_extensions->Remove(ext_str, NULL)); |
| 89 } | 89 } |
| 90 | 90 |
| 91 virtual void OnExternalProviderReady() { | 91 virtual void OnExternalProviderReady() { |
| 92 EXPECT_TRUE(provider_->IsReady()); | 92 EXPECT_TRUE(provider_->IsReady()); |
| 93 } | 93 } |
| 94 | 94 |
| 95 private: | 95 private: |
| 96 ListValue* remaining_extensions; | 96 ListValue* remaining_extensions; |
| 97 | 97 |
| 98 scoped_ptr<TestingProfile> profile_; | 98 scoped_ptr<TestingProfile> profile_; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;http#//www.example.com/crx")); | 137 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;http#//www.example.com/crx")); |
| 138 forced_extensions.Append(Value::CreateStringValue( | 138 forced_extensions.Append(Value::CreateStringValue( |
| 139 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")); | 139 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")); |
| 140 forced_extensions.Append(Value::CreateStringValue( | 140 forced_extensions.Append(Value::CreateStringValue( |
| 141 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaahttp#//www.example.com/crx")); | 141 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaahttp#//www.example.com/crx")); |
| 142 | 142 |
| 143 MockExternalPolicyExtensionProviderVisitor mv; | 143 MockExternalPolicyExtensionProviderVisitor mv; |
| 144 std::set<std::string> empty; | 144 std::set<std::string> empty; |
| 145 mv.Visit(&forced_extensions, &valid_extensions, empty); | 145 mv.Visit(&forced_extensions, &valid_extensions, empty); |
| 146 } | 146 } |
| OLD | NEW |