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

Side by Side Diff: content/browser/webui/web_ui_data_source_unittest.cc

Issue 1996723002: Switch ResourceBundle LoadDataResourceBytes to return RefCountedMemory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update to address newly added use Created 4 years, 6 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
« no previous file with comments | « chromecast/common/cast_content_client.cc ('k') | content/public/common/content_client.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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/macros.h" 6 #include "base/macros.h"
7 #include "base/memory/ref_counted_memory.h" 7 #include "base/memory/ref_counted_memory.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "content/browser/webui/web_ui_data_source_impl.h" 9 #include "content/browser/webui/web_ui_data_source_impl.h"
10 #include "content/public/test/test_browser_thread_bundle.h" 10 #include "content/public/test/test_browser_thread_bundle.h"
(...skipping 15 matching lines...) Expand all
26 public: 26 public:
27 TestClient() {} 27 TestClient() {}
28 ~TestClient() override {} 28 ~TestClient() override {}
29 29
30 base::string16 GetLocalizedString(int message_id) const override { 30 base::string16 GetLocalizedString(int message_id) const override {
31 if (message_id == kDummyStringId) 31 if (message_id == kDummyStringId)
32 return base::UTF8ToUTF16(kDummyString); 32 return base::UTF8ToUTF16(kDummyString);
33 return base::string16(); 33 return base::string16();
34 } 34 }
35 35
36 base::RefCountedStaticMemory* GetDataResourceBytes( 36 base::RefCountedMemory* GetDataResourceBytes(
37 int resource_id) const override { 37 int resource_id) const override {
38 base::RefCountedStaticMemory* bytes = NULL; 38 base::RefCountedStaticMemory* bytes = NULL;
39 if (resource_id == kDummyDefaultResourceId) { 39 if (resource_id == kDummyDefaultResourceId) {
40 bytes = new base::RefCountedStaticMemory( 40 bytes = new base::RefCountedStaticMemory(
41 kDummyDefaultResource, arraysize(kDummyDefaultResource)); 41 kDummyDefaultResource, arraysize(kDummyDefaultResource));
42 } else if (resource_id == kDummyResourceId) { 42 } else if (resource_id == kDummyResourceId) {
43 bytes = new base::RefCountedStaticMemory(kDummyResource, 43 bytes = new base::RefCountedStaticMemory(kDummyResource,
44 arraysize(kDummyResource)); 44 arraysize(kDummyResource));
45 } 45 }
46 return bytes; 46 return bytes;
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 EXPECT_EQ(GetMimeType(".css.foo"), html); 199 EXPECT_EQ(GetMimeType(".css.foo"), html);
200 200
201 // With query strings. 201 // With query strings.
202 EXPECT_EQ(GetMimeType("foo?abc?abc"), html); 202 EXPECT_EQ(GetMimeType("foo?abc?abc"), html);
203 EXPECT_EQ(GetMimeType("foo.html?abc?abc"), html); 203 EXPECT_EQ(GetMimeType("foo.html?abc?abc"), html);
204 EXPECT_EQ(GetMimeType("foo.css?abc?abc"), css); 204 EXPECT_EQ(GetMimeType("foo.css?abc?abc"), css);
205 EXPECT_EQ(GetMimeType("foo.js?abc?abc"), js); 205 EXPECT_EQ(GetMimeType("foo.js?abc?abc"), js);
206 } 206 }
207 207
208 } // namespace content 208 } // namespace content
OLDNEW
« no previous file with comments | « chromecast/common/cast_content_client.cc ('k') | content/public/common/content_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698