| 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 #import "chrome/common/mac/app_mode_chrome_locator.h" | 5 #import "chrome/common/mac/app_mode_chrome_locator.h" |
| 6 | 6 |
| 7 #include <CoreFoundation/CoreFoundation.h> | 7 #include <CoreFoundation/CoreFoundation.h> |
| 8 | 8 |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 EXPECT_FALSE(app_mode::FindBundleById(@"this.doesnt.exist", &dummy)); | 43 EXPECT_FALSE(app_mode::FindBundleById(@"this.doesnt.exist", &dummy)); |
| 44 } | 44 } |
| 45 | 45 |
| 46 TEST(ChromeLocatorTest, GetNonExistentBundleInfo) { | 46 TEST(ChromeLocatorTest, GetNonExistentBundleInfo) { |
| 47 base::ScopedTempDir temp_dir; | 47 base::ScopedTempDir temp_dir; |
| 48 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); | 48 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); |
| 49 | 49 |
| 50 base::FilePath executable_path; | 50 base::FilePath executable_path; |
| 51 base::FilePath version_path; | 51 base::FilePath version_path; |
| 52 base::FilePath framework_path; | 52 base::FilePath framework_path; |
| 53 EXPECT_FALSE(app_mode::GetChromeBundleInfo(temp_dir.path(), | 53 EXPECT_FALSE(app_mode::GetChromeBundleInfo(temp_dir.GetPath(), std::string(), |
| 54 std::string(), | 54 &executable_path, &version_path, |
| 55 &executable_path, | |
| 56 &version_path, | |
| 57 &framework_path)); | 55 &framework_path)); |
| 58 } | 56 } |
| 59 | 57 |
| 60 TEST(ChromeLocatorTest, GetChromeBundleInfo) { | 58 TEST(ChromeLocatorTest, GetChromeBundleInfo) { |
| 61 base::FilePath chrome_bundle_path; | 59 base::FilePath chrome_bundle_path; |
| 62 GetChromeBundlePath(&chrome_bundle_path); | 60 GetChromeBundlePath(&chrome_bundle_path); |
| 63 ASSERT_TRUE(base::DirectoryExists(chrome_bundle_path)); | 61 ASSERT_TRUE(base::DirectoryExists(chrome_bundle_path)); |
| 64 | 62 |
| 65 base::FilePath executable_path; | 63 base::FilePath executable_path; |
| 66 base::FilePath version_path; | 64 base::FilePath version_path; |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 std::string("previous_version"), | 130 std::string("previous_version"), |
| 133 &executable_path, | 131 &executable_path, |
| 134 &version_path, | 132 &version_path, |
| 135 &framework_path)); | 133 &framework_path)); |
| 136 EXPECT_TRUE(base::PathExists(executable_path)); | 134 EXPECT_TRUE(base::PathExists(executable_path)); |
| 137 EXPECT_TRUE(base::DirectoryExists(version_path)); | 135 EXPECT_TRUE(base::DirectoryExists(version_path)); |
| 138 EXPECT_TRUE(base::PathExists(framework_path)); | 136 EXPECT_TRUE(base::PathExists(framework_path)); |
| 139 | 137 |
| 140 base::DeleteFile(fake_version_directory, false); | 138 base::DeleteFile(fake_version_directory, false); |
| 141 } | 139 } |
| OLD | NEW |