Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/json_reader.h" | 10 #include "base/json_reader.h" |
| (...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 509 FilePath output_directory; | 509 FilePath output_directory; |
| 510 file_util::CreateNewTempDirectory(FILE_PATH_LITERAL("chrome_"), | 510 file_util::CreateNewTempDirectory(FILE_PATH_LITERAL("chrome_"), |
| 511 &output_directory); | 511 &output_directory); |
| 512 FilePath crx_path(output_directory.AppendASCII("ex1.crx")); | 512 FilePath crx_path(output_directory.AppendASCII("ex1.crx")); |
| 513 FilePath privkey_path(output_directory.AppendASCII("privkey.pem")); | 513 FilePath privkey_path(output_directory.AppendASCII("privkey.pem")); |
| 514 | 514 |
| 515 scoped_ptr<ExtensionCreator> creator(new ExtensionCreator()); | 515 scoped_ptr<ExtensionCreator> creator(new ExtensionCreator()); |
| 516 ASSERT_TRUE(creator->Run(input_directory, crx_path, FilePath(), | 516 ASSERT_TRUE(creator->Run(input_directory, crx_path, FilePath(), |
| 517 privkey_path)); | 517 privkey_path)); |
| 518 | 518 |
| 519 std::string priv_key; | |
| 520 file_util::ReadFileToString(crx_path, &priv_key); | |
| 521 LOG(INFO) << "Private key:\n" << priv_key; | |
|
Erik does not do reviews
2009/06/16 00:32:55
is log level set right on the bots? or should thi
| |
| 522 | |
| 519 ASSERT_TRUE(file_util::PathExists(privkey_path)); | 523 ASSERT_TRUE(file_util::PathExists(privkey_path)); |
| 520 InstallExtension(crx_path, true); | 524 InstallExtension(crx_path, true); |
| 521 | 525 |
| 522 file_util::Delete(crx_path, false); | 526 file_util::Delete(crx_path, false); |
| 523 file_util::Delete(privkey_path, false); | 527 file_util::Delete(privkey_path, false); |
| 524 } | 528 } |
| 525 | 529 |
| 526 // Test Packaging and installing an extension using an openssl generated key. | 530 // Test Packaging and installing an extension using an openssl generated key. |
| 527 // The openssl is generated with the following: | 531 // The openssl is generated with the following: |
| 528 // > openssl genrsa -out privkey.pem 1024 | 532 // > openssl genrsa -out privkey.pem 1024 |
| (...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1007 ValidatePrefKeyCount(1); | 1011 ValidatePrefKeyCount(1); |
| 1008 ValidatePref(good_crx, L"state", Extension::KILLBIT); | 1012 ValidatePref(good_crx, L"state", Extension::KILLBIT); |
| 1009 ValidatePref(good_crx, L"location", Extension::EXTERNAL_PREF); | 1013 ValidatePref(good_crx, L"location", Extension::EXTERNAL_PREF); |
| 1010 | 1014 |
| 1011 // The extension should also be gone from disk. | 1015 // The extension should also be gone from disk. |
| 1012 FilePath extension_path = install_path.DirName(); | 1016 FilePath extension_path = install_path.DirName(); |
| 1013 extension_path = extension_path.AppendASCII(good_crx); | 1017 extension_path = extension_path.AppendASCII(good_crx); |
| 1014 EXPECT_FALSE(file_util::PathExists(extension_path)) << | 1018 EXPECT_FALSE(file_util::PathExists(extension_path)) << |
| 1015 extension_path.ToWStringHack(); | 1019 extension_path.ToWStringHack(); |
| 1016 } | 1020 } |
| OLD | NEW |