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

Side by Side Diff: chrome/browser/ui/webui/chrome_web_ui_data_source_unittest.cc

Issue 10272004: Move RefCountedMemory class to base namespace. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 years, 7 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/memory/ref_counted_memory.h" 5 #include "base/memory/ref_counted_memory.h"
6 #include "base/utf_string_conversions.h" 6 #include "base/utf_string_conversions.h"
7 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" 7 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h"
8 #include "grit/common_resources.h" 8 #include "grit/common_resources.h"
9 #include "grit/generated_resources.h" 9 #include "grit/generated_resources.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 11 matching lines...) Expand all
22 virtual void StartDataRequest( 22 virtual void StartDataRequest(
23 const std::string& path, bool is_incognito, int request_id) OVERRIDE { 23 const std::string& path, bool is_incognito, int request_id) OVERRIDE {
24 ChromeWebUIDataSource::StartDataRequest(path, is_incognito, request_id); 24 ChromeWebUIDataSource::StartDataRequest(path, is_incognito, request_id);
25 } 25 }
26 26
27 virtual std::string GetMimeType(const std::string& path) const OVERRIDE { 27 virtual std::string GetMimeType(const std::string& path) const OVERRIDE {
28 return ChromeWebUIDataSource::GetMimeType(path); 28 return ChromeWebUIDataSource::GetMimeType(path);
29 } 29 }
30 30
31 // Store response for later comparisons. 31 // Store response for later comparisons.
32 virtual void SendResponse(int request_id, RefCountedMemory* data) { 32 virtual void SendResponse(int request_id, base::RefCountedMemory* data) {
33 result_request_id_ = request_id; 33 result_request_id_ = request_id;
34 result_data_ = data; 34 result_data_ = data;
35 } 35 }
36 36
37 int result_request_id_; 37 int result_request_id_;
38 scoped_refptr<RefCountedMemory> result_data_; 38 scoped_refptr<base::RefCountedMemory> result_data_;
39 39
40 private: 40 private:
41 virtual ~MockChromeWebUIDataSource() {} 41 virtual ~MockChromeWebUIDataSource() {}
42 }; 42 };
43 43
44 class ChromeWebUIDataSourceTest : public testing::Test { 44 class ChromeWebUIDataSourceTest : public testing::Test {
45 public: 45 public:
46 ChromeWebUIDataSourceTest() {} 46 ChromeWebUIDataSourceTest() {}
47 virtual ~ChromeWebUIDataSourceTest() {} 47 virtual ~ChromeWebUIDataSourceTest() {}
48 MockChromeWebUIDataSource* source() { return source_.get(); } 48 MockChromeWebUIDataSource* source() { return source_.get(); }
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 const char* js = "application/javascript"; 118 const char* js = "application/javascript";
119 EXPECT_EQ(source()->GetMimeType(""), html); 119 EXPECT_EQ(source()->GetMimeType(""), html);
120 EXPECT_EQ(source()->GetMimeType("foo"), html); 120 EXPECT_EQ(source()->GetMimeType("foo"), html);
121 EXPECT_EQ(source()->GetMimeType("foo.html"), html); 121 EXPECT_EQ(source()->GetMimeType("foo.html"), html);
122 EXPECT_EQ(source()->GetMimeType(".js"), js); 122 EXPECT_EQ(source()->GetMimeType(".js"), js);
123 EXPECT_EQ(source()->GetMimeType("foo.js"), js); 123 EXPECT_EQ(source()->GetMimeType("foo.js"), js);
124 EXPECT_EQ(source()->GetMimeType("js"), html); 124 EXPECT_EQ(source()->GetMimeType("js"), html);
125 EXPECT_EQ(source()->GetMimeType("foojs"), html); 125 EXPECT_EQ(source()->GetMimeType("foojs"), html);
126 EXPECT_EQ(source()->GetMimeType("foo.jsp"), html); 126 EXPECT_EQ(source()->GetMimeType("foo.jsp"), html);
127 } 127 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc ('k') | chrome/browser/ui/webui/chromeos/register_page_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698