Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: chrome_elf/chrome_elf_util_unittest.cc

Issue 2017853002: Add functionality to the install_static library to tokenize strings and compare versions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add install_static_unittests to other windows bots Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <tuple> 5 #include <tuple>
6 6
7 #include "base/test/test_reg_util_win.h" 7 #include "base/test/test_reg_util_win.h"
8 #include "base/win/registry.h" 8 #include "base/win/registry.h"
9 #include "chrome/install_static/install_util.h" 9 #include "chrome/install_static/install_util.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 392
393 INSTANTIATE_TEST_CASE_P(Canary, ChromeElfUtilTest, 393 INSTANTIATE_TEST_CASE_P(Canary, ChromeElfUtilTest,
394 testing::Combine(testing::Values("canary"), 394 testing::Combine(testing::Values("canary"),
395 testing::Values("user"), 395 testing::Values("user"),
396 testing::Values("single"))); 396 testing::Values("single")));
397 INSTANTIATE_TEST_CASE_P(GoogleChrome, ChromeElfUtilTest, 397 INSTANTIATE_TEST_CASE_P(GoogleChrome, ChromeElfUtilTest,
398 testing::Combine(testing::Values("google"), 398 testing::Combine(testing::Values("google"),
399 testing::Values("user", "system"), 399 testing::Values("user", "system"),
400 testing::Values("single", "multi"))); 400 testing::Values("single", "multi")));
401 401
402 // Tests the MatchPattern function in the install_static library.
403 // TODO(ananta)
404 // Move this to install_static_unittests.
405 // http://crbug.com/604923
406 TEST(MiscUtilTest, InstallStaticMatchPattern) {
407 EXPECT_TRUE(install_static::MatchPattern(L"", L""));
408 EXPECT_TRUE(install_static::MatchPattern(L"", L"*"));
409 EXPECT_FALSE(install_static::MatchPattern(L"", L"*a"));
410 EXPECT_FALSE(install_static::MatchPattern(L"", L"abc"));
411 EXPECT_TRUE(install_static::MatchPattern(L"Hello1234", L"He??o*1*"));
412 EXPECT_TRUE(install_static::MatchPattern(L"Foo", L"F*?"));
413 EXPECT_TRUE(install_static::MatchPattern(L"Foo", L"F*"));
414 EXPECT_FALSE(install_static::MatchPattern(L"Foo", L"F*b"));
415 EXPECT_TRUE(install_static::MatchPattern(L"abcd", L"*c*d"));
416 EXPECT_TRUE(install_static::MatchPattern(L"abcd", L"*?c*d"));
417 EXPECT_FALSE(install_static::MatchPattern(L"abcd", L"abcd*efgh"));
418 EXPECT_TRUE(install_static::MatchPattern(L"foobarabc", L"*bar*"));
419 }
420
421 } // namespace 402 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698