| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |