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

Side by Side Diff: chrome/renderer/plugins/plugin_uma_unittest.cc

Issue 13145003: Rewrite std::string("") to std::string(), Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ugh Created 7 years, 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <gtest/gtest.h> 5 #include <gtest/gtest.h>
6 6
7 #include "chrome/renderer/plugins/plugin_uma.h" 7 #include "chrome/renderer/plugins/plugin_uma.h"
8 8
9 class PluginUMATest : public testing::Test { 9 class PluginUMATest : public testing::Test {
10 public: 10 public:
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 GURL("some url")); 111 GURL("some url"));
112 ExpectPluginType(PluginUMAReporter::UNSUPPORTED_MIMETYPE, 112 ExpectPluginType(PluginUMAReporter::UNSUPPORTED_MIMETYPE,
113 "application/x-ppapi-widevine-cdm-sufix", 113 "application/x-ppapi-widevine-cdm-sufix",
114 GURL("some url")); 114 GURL("some url"));
115 ExpectPluginType(PluginUMAReporter::UNSUPPORTED_MIMETYPE, 115 ExpectPluginType(PluginUMAReporter::UNSUPPORTED_MIMETYPE,
116 "prefix-application/x-ppapi-widevine-cdm", 116 "prefix-application/x-ppapi-widevine-cdm",
117 GURL("some url")); 117 GURL("some url"));
118 } 118 }
119 119
120 TEST_F(PluginUMATest, BySrcExtension) { 120 TEST_F(PluginUMATest, BySrcExtension) {
121 ExpectPluginType(PluginUMAReporter::QUICKTIME, 121 ExpectPluginType(
122 "", 122 PluginUMAReporter::QUICKTIME, std::string(), GURL("file://file.mov"));
123 GURL("file://file.mov"));
124 123
125 // When plugin's mime type is given, we don't check extension. 124 // When plugin's mime type is given, we don't check extension.
126 ExpectPluginType(PluginUMAReporter::UNSUPPORTED_MIMETYPE, 125 ExpectPluginType(PluginUMAReporter::UNSUPPORTED_MIMETYPE,
127 "unknown-plugin", 126 "unknown-plugin",
128 GURL("http://file.mov")); 127 GURL("http://file.mov"));
129 128
130 ExpectPluginType(PluginUMAReporter::WINDOWS_MEDIA_PLAYER, 129 ExpectPluginType(PluginUMAReporter::WINDOWS_MEDIA_PLAYER,
131 "", 130 std::string(),
132 GURL("file://file.asx")); 131 GURL("file://file.asx"));
133 ExpectPluginType(PluginUMAReporter::REALPLAYER, 132 ExpectPluginType(
134 "", 133 PluginUMAReporter::REALPLAYER, std::string(), GURL("file://file.rm"));
135 GURL("file://file.rm"));
136 ExpectPluginType(PluginUMAReporter::QUICKTIME, 134 ExpectPluginType(PluginUMAReporter::QUICKTIME,
137 "", 135 std::string(),
138 GURL("http://aaa/file.mov?x=aaaa&y=b#c")); 136 GURL("http://aaa/file.mov?x=aaaa&y=b#c"));
139 ExpectPluginType(PluginUMAReporter::QUICKTIME, 137 ExpectPluginType(PluginUMAReporter::QUICKTIME,
140 "", 138 std::string(),
141 GURL("http://file.mov?x=aaaa&y=b#c")); 139 GURL("http://file.mov?x=aaaa&y=b#c"));
142 ExpectPluginType(PluginUMAReporter::SHOCKWAVE_FLASH, 140 ExpectPluginType(PluginUMAReporter::SHOCKWAVE_FLASH,
143 "", 141 std::string(),
144 GURL("http://file.swf?x=aaaa&y=b#c")); 142 GURL("http://file.swf?x=aaaa&y=b#c"));
145 ExpectPluginType(PluginUMAReporter::SHOCKWAVE_FLASH, 143 ExpectPluginType(PluginUMAReporter::SHOCKWAVE_FLASH,
146 "", 144 std::string(),
147 GURL("http://file.spl?x=aaaa&y=b#c")); 145 GURL("http://file.spl?x=aaaa&y=b#c"));
148 146
149 ExpectPluginType(PluginUMAReporter::UNSUPPORTED_EXTENSION, 147 ExpectPluginType(PluginUMAReporter::UNSUPPORTED_EXTENSION,
150 "", 148 std::string(),
151 GURL("http://file.unknown_extension")); 149 GURL("http://file.unknown_extension"));
152 ExpectPluginType(PluginUMAReporter::UNSUPPORTED_EXTENSION, 150 ExpectPluginType(
153 "", 151 PluginUMAReporter::UNSUPPORTED_EXTENSION, std::string(), GURL("http://"));
154 GURL("http://")); 152 ExpectPluginType(
155 ExpectPluginType(PluginUMAReporter::UNSUPPORTED_EXTENSION, 153 PluginUMAReporter::UNSUPPORTED_EXTENSION, std::string(), GURL("mov"));
156 "",
157 GURL("mov"));
158 } 154 }
159 155
160 TEST_F(PluginUMATest, CaseSensitivity) { 156 TEST_F(PluginUMATest, CaseSensitivity) {
161 ExpectPluginType(PluginUMAReporter::QUICKTIME, 157 ExpectPluginType(PluginUMAReporter::QUICKTIME,
162 "video/QUICKTIME", 158 "video/QUICKTIME",
163 GURL("http://file.aaa")); 159 GURL("http://file.aaa"));
164 ExpectPluginType(PluginUMAReporter::QUICKTIME, 160 ExpectPluginType(
165 "", 161 PluginUMAReporter::QUICKTIME, std::string(), GURL("http://file.MoV"));
166 GURL("http://file.MoV"));
167 } 162 }
OLDNEW
« no previous file with comments | « chrome/renderer/extensions/user_script_slave.cc ('k') | chrome/renderer/safe_browsing/malware_dom_details_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698