Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(125)

Side by Side Diff: chrome/browser/extensions/external_policy_loader_unittest.cc

Issue 1281313003: base: Remove using:: declaration from version.h header. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more fixes Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 Extension::NO_FLAGS)); 63 Extension::NO_FLAGS));
64 64
65 // Extensions will be removed from this list as they visited, 65 // Extensions will be removed from this list as they visited,
66 // so it should be emptied by the end. 66 // so it should be emptied by the end.
67 expected_extensions_ = expected_extensions; 67 expected_extensions_ = expected_extensions;
68 provider_->VisitRegisteredExtension(); 68 provider_->VisitRegisteredExtension();
69 EXPECT_TRUE(expected_extensions_.empty()); 69 EXPECT_TRUE(expected_extensions_.empty());
70 } 70 }
71 71
72 bool OnExternalExtensionFileFound(const std::string& id, 72 bool OnExternalExtensionFileFound(const std::string& id,
73 const Version* version, 73 const base::Version* version,
74 const base::FilePath& path, 74 const base::FilePath& path,
75 Manifest::Location unused, 75 Manifest::Location unused,
76 int unused2, 76 int unused2,
77 bool unused3, 77 bool unused3,
78 bool unused4) override { 78 bool unused4) override {
79 ADD_FAILURE() << "There should be no external extensions from files."; 79 ADD_FAILURE() << "There should be no external extensions from files.";
80 return false; 80 return false;
81 } 81 }
82 82
83 bool OnExternalExtensionUpdateUrlFound(const std::string& id, 83 bool OnExternalExtensionUpdateUrlFound(const std::string& id,
84 const std::string& install_parameter, 84 const std::string& install_parameter,
85 const GURL& update_url, 85 const GURL& update_url,
86 Manifest::Location location, 86 Manifest::Location location,
87 int unused1, 87 int unused1,
88 bool unused2) override { 88 bool unused2) override {
89 // Extension has the correct location. 89 // Extension has the correct location.
90 EXPECT_EQ(Manifest::EXTERNAL_POLICY_DOWNLOAD, location); 90 EXPECT_EQ(Manifest::EXTERNAL_POLICY_DOWNLOAD, location);
91 91
92 // Provider returns the correct location when asked. 92 // Provider returns the correct location when asked.
93 Manifest::Location location1; 93 Manifest::Location location1;
94 scoped_ptr<Version> version1; 94 scoped_ptr<base::Version> version1;
95 provider_->GetExtensionDetails(id, &location1, &version1); 95 provider_->GetExtensionDetails(id, &location1, &version1);
96 EXPECT_EQ(Manifest::EXTERNAL_POLICY_DOWNLOAD, location1); 96 EXPECT_EQ(Manifest::EXTERNAL_POLICY_DOWNLOAD, location1);
97 EXPECT_FALSE(version1.get()); 97 EXPECT_FALSE(version1.get());
98 98
99 // Remove the extension from our list. 99 // Remove the extension from our list.
100 EXPECT_EQ(1U, expected_extensions_.erase(id)); 100 EXPECT_EQ(1U, expected_extensions_.erase(id));
101 return true; 101 return true;
102 } 102 }
103 103
104 void OnExternalProviderReady( 104 void OnExternalProviderReady(
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 forced_extensions.SetString("invalid", "http://www.example.com/crx"); 146 forced_extensions.SetString("invalid", "http://www.example.com/crx");
147 forced_extensions.SetString("dddddddddddddddddddddddddddddddd", 147 forced_extensions.SetString("dddddddddddddddddddddddddddddddd",
148 std::string()); 148 std::string());
149 forced_extensions.SetString("invalid", "bad"); 149 forced_extensions.SetString("invalid", "bad");
150 150
151 MockExternalPolicyProviderVisitor mv; 151 MockExternalPolicyProviderVisitor mv;
152 mv.Visit(forced_extensions, expected_extensions); 152 mv.Visit(forced_extensions, expected_extensions);
153 } 153 }
154 154
155 } // namespace extensions 155 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_sync_data_unittest.cc ('k') | chrome/browser/extensions/external_provider_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698