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 #include "chrome/installer/util/product_unittest.h" | 5 #include "chrome/installer/util/product_unittest.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/test/test_reg_util_win.h" | 8 #include "base/test/test_reg_util_win.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/common/chrome_constants.h" | 10 #include "chrome/common/chrome_constants.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 machine_state.Initialize(); | 66 machine_state.Initialize(); |
67 installer::InstallerState installer_state; | 67 installer::InstallerState installer_state; |
68 installer_state.Initialize(cmd_line, prefs, machine_state); | 68 installer_state.Initialize(cmd_line, prefs, machine_state); |
69 | 69 |
70 const Product* product = installer_state.products()[0]; | 70 const Product* product = installer_state.products()[0]; |
71 BrowserDistribution* distribution = product->distribution(); | 71 BrowserDistribution* distribution = product->distribution(); |
72 EXPECT_EQ(BrowserDistribution::CHROME_BROWSER, distribution->GetType()); | 72 EXPECT_EQ(BrowserDistribution::CHROME_BROWSER, distribution->GetType()); |
73 | 73 |
74 std::vector<FilePath> user_data_paths; | 74 std::vector<FilePath> user_data_paths; |
75 product->GetUserDataPaths(&user_data_paths); | 75 product->GetUserDataPaths(&user_data_paths); |
76 EXPECT_LE(static_cast<size_t>(1), user_data_paths.size()); | 76 EXPECT_GE(user_data_paths.size(), static_cast<size_t>(1)); |
77 const FilePath& user_data = user_data_paths[0]; | 77 const FilePath& user_data = user_data_paths[0]; |
78 EXPECT_FALSE(user_data_paths[0].empty()); | 78 EXPECT_FALSE(user_data_paths[0].empty()); |
79 EXPECT_NE(std::wstring::npos, | 79 EXPECT_NE(std::wstring::npos, |
80 user_data_paths[0].value().find(installer::kInstallUserDataDir)); | 80 user_data_paths[0].value().find(installer::kInstallUserDataDir)); |
81 if (user_data_paths.size() > 1) { | 81 if (user_data_paths.size() > 1) { |
82 EXPECT_FALSE(user_data_paths[1].empty()); | 82 EXPECT_FALSE(user_data_paths[1].empty()); |
83 EXPECT_NE( | 83 EXPECT_NE( |
84 std::wstring::npos, | 84 std::wstring::npos, |
85 user_data_paths[1].value().find(chrome::kMetroChromeUserDataSubDir)); | 85 user_data_paths[1].value().find(chrome::kMetroChromeUserDataSubDir)); |
86 } | 86 } |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 if (chrome_state != NULL) | 137 if (chrome_state != NULL) |
138 EXPECT_TRUE(chrome_state->is_msi()); | 138 EXPECT_TRUE(chrome_state->is_msi()); |
139 } | 139 } |
140 } | 140 } |
141 | 141 |
142 TEST_F(ProductTest, LaunchChrome) { | 142 TEST_F(ProductTest, LaunchChrome) { |
143 // TODO(tommi): Test Product::LaunchChrome and | 143 // TODO(tommi): Test Product::LaunchChrome and |
144 // Product::LaunchChromeAndWait. | 144 // Product::LaunchChromeAndWait. |
145 LOG(ERROR) << "Test not implemented."; | 145 LOG(ERROR) << "Test not implemented."; |
146 } | 146 } |
OLD | NEW |