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

Unified Diff: gpu/command_buffer/service/shader_manager_unittest.cc

Issue 8404029: Strip comments from shader before checking for invalid characters (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 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/command_buffer/service/shader_manager_unittest.cc
diff --git a/gpu/command_buffer/service/shader_manager_unittest.cc b/gpu/command_buffer/service/shader_manager_unittest.cc
index f927e269790382c6dbda7a21bd66f3572f036c65..30f87d7d48ebc3d28c31d3133e8011d8728e1370 100644
--- a/gpu/command_buffer/service/shader_manager_unittest.cc
+++ b/gpu/command_buffer/service/shader_manager_unittest.cc
@@ -245,6 +245,27 @@ TEST_F(ShaderManagerTest, ShaderInfoUseCount) {
EXPECT_TRUE(info2 == NULL);
}
+TEST_F(ShaderManagerTest, StripComments) {
+ const char* kSource = ""
+ "// this is a single line comment\n"
+ "this is not a comment\n"
+ "/* this is\n"
+ "a multi line\n"
+ "comment */\n"
+ "this is not a comment\n"
+ "this is an /* inline */ comment";
+ const char* kExpected = ""
+ " \n"
+ "this is not a comment\n"
+ "/*\n"
+ "\n"
+ "*/\n"
+ "this is not a comment\n"
+ "this is an /**/ comment";
+ std::string actual = ShaderManager::StripComments(kSource);
+ EXPECT_STREQ(kExpected, actual.c_str());
+}
+
} // namespace gles2
} // namespace gpu

Powered by Google App Engine
This is Rietveld 408576698