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

Side by Side Diff: content/browser/webui/web_ui_data_source_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) 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/bind.h" 5 #include "base/bind.h"
6 #include "base/memory/ref_counted_memory.h" 6 #include "base/memory/ref_counted_memory.h"
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "content/browser/webui/web_ui_data_source_impl.h" 8 #include "content/browser/webui/web_ui_data_source_impl.h"
9 #include "content/test/test_content_client.h" 9 #include "content/test/test_content_client.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 StartDataRequest("strings.js"); 134 StartDataRequest("strings.js");
135 result = std::string( 135 result = std::string(
136 reinterpret_cast<const char*>(result_data_->front()), 136 reinterpret_cast<const char*>(result_data_->front()),
137 result_data_->size()); 137 result_data_->size());
138 EXPECT_NE(result.find(kDummyDefaultResource), std::string::npos); 138 EXPECT_NE(result.find(kDummyDefaultResource), std::string::npos);
139 } 139 }
140 140
141 TEST_F(WebUIDataSourceTest, MimeType) { 141 TEST_F(WebUIDataSourceTest, MimeType) {
142 const char* html = "text/html"; 142 const char* html = "text/html";
143 const char* js = "application/javascript"; 143 const char* js = "application/javascript";
144 EXPECT_EQ(GetMimeType(""), html); 144 EXPECT_EQ(GetMimeType(std::string()), html);
145 EXPECT_EQ(GetMimeType("foo"), html); 145 EXPECT_EQ(GetMimeType("foo"), html);
146 EXPECT_EQ(GetMimeType("foo.html"), html); 146 EXPECT_EQ(GetMimeType("foo.html"), html);
147 EXPECT_EQ(GetMimeType(".js"), js); 147 EXPECT_EQ(GetMimeType(".js"), js);
148 EXPECT_EQ(GetMimeType("foo.js"), js); 148 EXPECT_EQ(GetMimeType("foo.js"), js);
149 EXPECT_EQ(GetMimeType("js"), html); 149 EXPECT_EQ(GetMimeType("js"), html);
150 EXPECT_EQ(GetMimeType("foojs"), html); 150 EXPECT_EQ(GetMimeType("foojs"), html);
151 EXPECT_EQ(GetMimeType("foo.jsp"), html); 151 EXPECT_EQ(GetMimeType("foo.jsp"), html);
152 } 152 }
153 153
154 } // namespace content 154 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/web_contents/navigation_entry_impl_unittest.cc ('k') | content/browser/worker_host/test/worker_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698