OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/callback.h" | 6 #include "base/callback.h" |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "base/json/json_file_value_serializer.h" | 10 #include "base/json/json_file_value_serializer.h" |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 }; | 252 }; |
253 | 253 |
254 TEST_F(SupervisedUserWhitelistInstallerTest, GetHashFromCrxId) { | 254 TEST_F(SupervisedUserWhitelistInstallerTest, GetHashFromCrxId) { |
255 { | 255 { |
256 std::string extension_id = "abcdefghijklmnopponmlkjihgfedcba"; | 256 std::string extension_id = "abcdefghijklmnopponmlkjihgfedcba"; |
257 ASSERT_EQ(extension_id, CrxIdToHashToCrxId(extension_id)); | 257 ASSERT_EQ(extension_id, CrxIdToHashToCrxId(extension_id)); |
258 } | 258 } |
259 | 259 |
260 { | 260 { |
261 std::string extension_id = "aBcDeFgHiJkLmNoPpOnMlKjIhGfEdCbA"; | 261 std::string extension_id = "aBcDeFgHiJkLmNoPpOnMlKjIhGfEdCbA"; |
262 ASSERT_EQ(base::StringToLowerASCII(extension_id), | 262 ASSERT_EQ(base::ToLowerASCII(extension_id), |
263 CrxIdToHashToCrxId(extension_id)); | 263 CrxIdToHashToCrxId(extension_id)); |
264 } | 264 } |
265 | 265 |
266 { | 266 { |
267 std::string extension_id = crx_file::id_util::GenerateId("Moose"); | 267 std::string extension_id = crx_file::id_util::GenerateId("Moose"); |
268 ASSERT_EQ(extension_id, CrxIdToHashToCrxId(extension_id)); | 268 ASSERT_EQ(extension_id, CrxIdToHashToCrxId(extension_id)); |
269 } | 269 } |
270 } | 270 } |
271 | 271 |
272 TEST_F(SupervisedUserWhitelistInstallerTest, InstallNewWhitelist) { | 272 TEST_F(SupervisedUserWhitelistInstallerTest, InstallNewWhitelist) { |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 { | 350 { |
351 base::RunLoop run_loop; | 351 base::RunLoop run_loop; |
352 installer_->UnregisterWhitelist(kOtherClientId, kCrxId); | 352 installer_->UnregisterWhitelist(kOtherClientId, kCrxId); |
353 run_loop.RunUntilIdle(); | 353 run_loop.RunUntilIdle(); |
354 } | 354 } |
355 EXPECT_FALSE(component_update_service_.registered_component()); | 355 EXPECT_FALSE(component_update_service_.registered_component()); |
356 EXPECT_FALSE(base::DirectoryExists(whitelist_directory_)); | 356 EXPECT_FALSE(base::DirectoryExists(whitelist_directory_)); |
357 } | 357 } |
358 | 358 |
359 } // namespace component_updater | 359 } // namespace component_updater |
OLD | NEW |