OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/install_static/install_util.h" | 5 #include "chrome/install_static/install_util.h" |
6 | 6 |
7 #include <tuple> | 7 #include <tuple> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 EXPECT_EQ(L"123 456\tabc\\def", tokenized[0]); | 254 EXPECT_EQ(L"123 456\tabc\\def", tokenized[0]); |
255 EXPECT_EQ(L"ghi", tokenized[1]); | 255 EXPECT_EQ(L"ghi", tokenized[1]); |
256 | 256 |
257 tokenized = TokenizeCommandLineToArray(L"123\"456\"\tabc"); | 257 tokenized = TokenizeCommandLineToArray(L"123\"456\"\tabc"); |
258 ASSERT_EQ(2u, tokenized.size()); | 258 ASSERT_EQ(2u, tokenized.size()); |
259 EXPECT_EQ(L"123\"456\"", tokenized[0]); | 259 EXPECT_EQ(L"123\"456\"", tokenized[0]); |
260 EXPECT_EQ(L"abc", tokenized[1]); | 260 EXPECT_EQ(L"abc", tokenized[1]); |
261 } | 261 } |
262 | 262 |
263 TEST(InstallStaticTest, BrowserProcessTest) { | 263 TEST(InstallStaticTest, BrowserProcessTest) { |
264 EXPECT_FALSE(IsProcessTypeInitialized()); | |
265 InitializeProcessType(); | 264 InitializeProcessType(); |
266 EXPECT_FALSE(IsNonBrowserProcess()); | 265 EXPECT_FALSE(IsNonBrowserProcess()); |
267 } | 266 } |
268 | 267 |
269 class InstallStaticUtilTest | 268 class InstallStaticUtilTest |
270 : public ::testing::TestWithParam< | 269 : public ::testing::TestWithParam< |
271 std::tuple<InstallConstantIndex, const char*>> { | 270 std::tuple<InstallConstantIndex, const char*>> { |
272 protected: | 271 protected: |
273 InstallStaticUtilTest() | 272 InstallStaticUtilTest() |
274 : system_level_(std::string(std::get<1>(GetParam())) != "user"), | 273 : system_level_(std::string(std::get<1>(GetParam())) != "user"), |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 testing::Values("user"))); | 537 testing::Values("user"))); |
539 #else // GOOGLE_CHROME_BUILD | 538 #else // GOOGLE_CHROME_BUILD |
540 // Chromium supports user and system levels. | 539 // Chromium supports user and system levels. |
541 INSTANTIATE_TEST_CASE_P(Chromium, | 540 INSTANTIATE_TEST_CASE_P(Chromium, |
542 InstallStaticUtilTest, | 541 InstallStaticUtilTest, |
543 testing::Combine(testing::Values(CHROMIUM_INDEX), | 542 testing::Combine(testing::Values(CHROMIUM_INDEX), |
544 testing::Values("user", "system"))); | 543 testing::Values("user", "system"))); |
545 #endif // !GOOGLE_CHROME_BUILD | 544 #endif // !GOOGLE_CHROME_BUILD |
546 | 545 |
547 } // namespace install_static | 546 } // namespace install_static |
OLD | NEW |