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

Unified Diff: chrome/browser/ui/webui/fileicon_source_unittest.cc

Issue 11881055: Simplify WebUI data sources. Currently WebUI data sources implement a URLDataSourceDelegate interfa… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix issue in about_ui exposed by cros tests Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/fileicon_source_unittest.cc
===================================================================
--- chrome/browser/ui/webui/fileicon_source_unittest.cc (revision 176942)
+++ chrome/browser/ui/webui/fileicon_source_unittest.cc (working copy)
@@ -20,10 +20,11 @@
public:
explicit TestFileIconSource() {}
- MOCK_METHOD4(FetchFileIcon, void(const FilePath& path,
- ui::ScaleFactor scale_factor,
- IconLoader::IconSize icon_size,
- int request_id));
+ MOCK_METHOD4(FetchFileIcon,
+ void(const FilePath& path,
+ ui::ScaleFactor scale_factor,
+ IconLoader::IconSize icon_size,
+ const content::URLDataSource::GotDataCallback& callback));
virtual ~TestFileIconSource() {}
};
@@ -109,15 +110,22 @@
#endif
};
+// Test that the callback is NULL.
+MATCHER(CallbackIsNull, "") {
+ return arg.is_null();
+}
+
} // namespace
TEST_F(FileIconSourceTest, FileIconSource_Parse) {
for (unsigned i = 0; i < arraysize(kBasicExpectations); i++) {
scoped_ptr<TestFileIconSource> source(CreateFileIconSource());
+ content::URLDataSource::GotDataCallback callback;
EXPECT_CALL(*source.get(),
FetchFileIcon(FilePath(kBasicExpectations[i].unescaped_path),
kBasicExpectations[i].scale_factor,
- kBasicExpectations[i].size, i));
- source->StartDataRequest(kBasicExpectations[i].request_path, false, i);
+ kBasicExpectations[i].size, CallbackIsNull()));
+ source->StartDataRequest(kBasicExpectations[i].request_path, false,
+ callback);
}
}

Powered by Google App Engine
This is Rietveld 408576698