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

Unified Diff: gpu/config/gpu_control_list_string_info_unittest.cc

Issue 452293002: Use RE string pattern matching for blacklist strings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: gpu/config/gpu_control_list_string_info_unittest.cc
diff --git a/gpu/config/gpu_control_list_string_info_unittest.cc b/gpu/config/gpu_control_list_string_info_unittest.cc
deleted file mode 100644
index 39e2f5800ceaae51246f1476c81c74b8a7a2c453..0000000000000000000000000000000000000000
--- a/gpu/config/gpu_control_list_string_info_unittest.cc
+++ /dev/null
@@ -1,98 +0,0 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "gpu/config/gpu_control_list.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace gpu {
-
-class StringInfoTest : public testing::Test {
- public:
- StringInfoTest() { }
- virtual ~StringInfoTest() { }
-
- typedef GpuControlList::StringInfo StringInfo;
-};
-
-TEST_F(StringInfoTest, ValidStringInfo) {
- const std::string op[] = {
- "contains",
- "beginwith",
- "endwith",
- "="
- };
- for (size_t i = 0; i < arraysize(op); ++i) {
- {
- StringInfo info(op[i], std::string());
- EXPECT_TRUE(info.IsValid());
- }
- {
- StringInfo info(op[i], "hello");
- EXPECT_TRUE(info.IsValid());
- }
- }
-}
-
-TEST_F(StringInfoTest, InvalidStringInfo) {
- const std::string op[] = {
- "Contains",
- "BeginWith",
- "EndWith",
- " =",
- "= "
- };
- for (size_t i = 0; i < arraysize(op); ++i) {
- StringInfo info(op[i], "hello");
- EXPECT_FALSE(info.IsValid());
- }
-}
-
-TEST_F(StringInfoTest, StringComparison) {
- {
- StringInfo info("contains", "happy");
- EXPECT_TRUE(info.Contains("unhappy"));
- EXPECT_TRUE(info.Contains("happy1"));
- EXPECT_TRUE(info.Contains("happy"));
- EXPECT_TRUE(info.Contains("a happy dog"));
- EXPECT_TRUE(info.Contains("Happy"));
- EXPECT_TRUE(info.Contains("HAPPY"));
- EXPECT_FALSE(info.Contains("ha-ppy"));
- }
- {
- StringInfo info("beginwith", "happy");
- EXPECT_FALSE(info.Contains("unhappy"));
- EXPECT_TRUE(info.Contains("happy1"));
- EXPECT_TRUE(info.Contains("happy"));
- EXPECT_FALSE(info.Contains("a happy dog"));
- EXPECT_TRUE(info.Contains("Happy"));
- EXPECT_TRUE(info.Contains("HAPPY"));
- EXPECT_FALSE(info.Contains("ha-ppy"));
- }
- {
- StringInfo info("endwith", "happy");
- EXPECT_TRUE(info.Contains("unhappy"));
- EXPECT_FALSE(info.Contains("happy1"));
- EXPECT_TRUE(info.Contains("happy"));
- EXPECT_FALSE(info.Contains("a happy dog"));
- EXPECT_TRUE(info.Contains("Happy"));
- EXPECT_TRUE(info.Contains("HAPPY"));
- EXPECT_FALSE(info.Contains("ha-ppy"));
- }
- {
- StringInfo info("=", "happy");
- EXPECT_FALSE(info.Contains("unhappy"));
- EXPECT_FALSE(info.Contains("happy1"));
- EXPECT_TRUE(info.Contains("happy"));
- EXPECT_FALSE(info.Contains("a happy dog"));
- EXPECT_TRUE(info.Contains("Happy"));
- EXPECT_TRUE(info.Contains("HAPPY"));
- EXPECT_FALSE(info.Contains("ha-ppy"));
- EXPECT_FALSE(info.Contains("ha ppy"));
- EXPECT_FALSE(info.Contains(" happy"));
- EXPECT_FALSE(info.Contains("happy "));
- }
-}
-
-} // namespace gpu
-

Powered by Google App Engine
This is Rietveld 408576698