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 "base/logging.h" | 5 #include "base/logging.h" |
6 #include "content/test/gpu/gpu_test_expectations_parser.h" | 6 #include "content/test/gpu/gpu_test_expectations_parser.h" |
7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
8 | 8 |
9 class GPUTestExpectationsParserTest : public testing::Test { | 9 class GPUTestExpectationsParserTest : public testing::Test { |
10 public: | 10 public: |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 | 82 |
83 GPUTestExpectationsParser parser; | 83 GPUTestExpectationsParser parser; |
84 EXPECT_TRUE(parser.LoadTestExpectations(text)); | 84 EXPECT_TRUE(parser.LoadTestExpectations(text)); |
85 EXPECT_EQ(0u, parser.GetErrorMessages().size()); | 85 EXPECT_EQ(0u, parser.GetErrorMessages().size()); |
86 EXPECT_EQ(GPUTestExpectationsParser::kGpuTestPass, | 86 EXPECT_EQ(GPUTestExpectationsParser::kGpuTestPass, |
87 parser.GetTestExpectation("MyTest", bot_config())); | 87 parser.GetTestExpectation("MyTest", bot_config())); |
88 } | 88 } |
89 | 89 |
90 TEST_F(GPUTestExpectationsParserTest, AllModifiers) { | 90 TEST_F(GPUTestExpectationsParserTest, AllModifiers) { |
91 const std::string text = | 91 const std::string text = |
92 "BUG12345 XP VISTA WIN7 LEOPARD SNOWLEOPARD LION LINUX CHROMEOS " | 92 "BUG12345 XP VISTA WIN7 LEOPARD SNOWLEOPARD LION LINUX CHROMEOS ANDROID " |
93 "NVIDIA INTEL AMD VMWARE RELEASE DEBUG : MyTest = " | 93 "NVIDIA INTEL AMD VMWARE RELEASE DEBUG : MyTest = " |
94 "PASS FAIL FLAKY TIMEOUT SKIP"; | 94 "PASS FAIL FLAKY TIMEOUT SKIP"; |
95 | 95 |
96 GPUTestExpectationsParser parser; | 96 GPUTestExpectationsParser parser; |
97 EXPECT_TRUE(parser.LoadTestExpectations(text)); | 97 EXPECT_TRUE(parser.LoadTestExpectations(text)); |
98 EXPECT_EQ(0u, parser.GetErrorMessages().size()); | 98 EXPECT_EQ(0u, parser.GetErrorMessages().size()); |
99 EXPECT_EQ(GPUTestExpectationsParser::kGpuTestPass | | 99 EXPECT_EQ(GPUTestExpectationsParser::kGpuTestPass | |
100 GPUTestExpectationsParser::kGpuTestFail | | 100 GPUTestExpectationsParser::kGpuTestFail | |
101 GPUTestExpectationsParser::kGpuTestFlaky | | 101 GPUTestExpectationsParser::kGpuTestFlaky | |
102 GPUTestExpectationsParser::kGpuTestTimeout | | 102 GPUTestExpectationsParser::kGpuTestTimeout | |
103 GPUTestExpectationsParser::kGpuTestSkip, | 103 GPUTestExpectationsParser::kGpuTestSkip, |
104 parser.GetTestExpectation("MyTest", bot_config())); | 104 parser.GetTestExpectation("MyTest", bot_config())); |
105 } | 105 } |
106 | 106 |
107 TEST_F(GPUTestExpectationsParserTest, DuplicateModifiers) { | 107 TEST_F(GPUTestExpectationsParserTest, DuplicateModifiers) { |
108 const std::string text = | 108 const std::string text = |
109 "BUG12345 WIN7 WIN7 RELEASE NVIDIA 0x0640 : MyTest = FAIL"; | 109 "BUG12345 WIN7 WIN7 RELEASE NVIDIA 0x0640 : MyTest = FAIL"; |
110 | 110 |
111 GPUTestExpectationsParser parser; | 111 GPUTestExpectationsParser parser; |
112 EXPECT_FALSE(parser.LoadTestExpectations(text)); | 112 EXPECT_FALSE(parser.LoadTestExpectations(text)); |
113 EXPECT_NE(0u, parser.GetErrorMessages().size()); | 113 EXPECT_NE(0u, parser.GetErrorMessages().size()); |
114 } | 114 } |
115 | 115 |
116 TEST_F(GPUTestExpectationsParserTest, AllModifiersLowerCase) { | 116 TEST_F(GPUTestExpectationsParserTest, AllModifiersLowerCase) { |
117 const std::string text = | 117 const std::string text = |
118 "BUG12345 xp vista win7 leopard snowleopard lion linux chromeos " | 118 "BUG12345 xp vista win7 leopard snowleopard lion linux chromeos android " |
119 "nvidia intel amd vmware release debug : MyTest = " | 119 "nvidia intel amd vmware release debug : MyTest = " |
120 "pass fail flaky timeout skip"; | 120 "pass fail flaky timeout skip"; |
121 | 121 |
122 GPUTestExpectationsParser parser; | 122 GPUTestExpectationsParser parser; |
123 EXPECT_TRUE(parser.LoadTestExpectations(text)); | 123 EXPECT_TRUE(parser.LoadTestExpectations(text)); |
124 EXPECT_EQ(0u, parser.GetErrorMessages().size()); | 124 EXPECT_EQ(0u, parser.GetErrorMessages().size()); |
125 EXPECT_EQ(GPUTestExpectationsParser::kGpuTestPass | | 125 EXPECT_EQ(GPUTestExpectationsParser::kGpuTestPass | |
126 GPUTestExpectationsParser::kGpuTestFail | | 126 GPUTestExpectationsParser::kGpuTestFail | |
127 GPUTestExpectationsParser::kGpuTestFlaky | | 127 GPUTestExpectationsParser::kGpuTestFlaky | |
128 GPUTestExpectationsParser::kGpuTestTimeout | | 128 GPUTestExpectationsParser::kGpuTestTimeout | |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 | 240 |
241 TEST_F(GPUTestExpectationsParserTest, WebGLTestExpectationsValidation) { | 241 TEST_F(GPUTestExpectationsParserTest, WebGLTestExpectationsValidation) { |
242 GPUTestExpectationsParser parser; | 242 GPUTestExpectationsParser parser; |
243 EXPECT_TRUE(parser.LoadTestExpectations( | 243 EXPECT_TRUE(parser.LoadTestExpectations( |
244 GPUTestExpectationsParser::kWebGLConformanceTest)); | 244 GPUTestExpectationsParser::kWebGLConformanceTest)); |
245 EXPECT_EQ(0u, parser.GetErrorMessages().size()); | 245 EXPECT_EQ(0u, parser.GetErrorMessages().size()); |
246 for (size_t i = 0; i < parser.GetErrorMessages().size(); ++i) | 246 for (size_t i = 0; i < parser.GetErrorMessages().size(); ++i) |
247 LOG(ERROR) << parser.GetErrorMessages()[i]; | 247 LOG(ERROR) << parser.GetErrorMessages()[i]; |
248 } | 248 } |
249 | 249 |
OLD | NEW |