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

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

Issue 11885021: Don't derive from ChromeURLDataManager::DataSource, and instead have these classes implement a dele… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: nits 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/web_ui_browsertest.cc
===================================================================
--- chrome/browser/ui/webui/web_ui_browsertest.cc (revision 176443)
+++ chrome/browser/ui/webui/web_ui_browsertest.cc (working copy)
@@ -28,6 +28,7 @@
#include "chrome/test/base/test_tab_strip_model_observer.h"
#include "chrome/test/base/ui_test_utils.h"
#include "content/public/browser/navigation_controller.h"
+#include "content/public/browser/url_data_source_delegate.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui_controller.h"
#include "content/public/browser/web_ui_message_handler.h"
@@ -267,21 +268,24 @@
// page is shown. While this doesn't matter for most tests, without it,
// navigation to different anchors cannot be listened to (via the hashchange
// event).
-class MockWebUIDataSource : public ChromeURLDataManager::DataSource {
+class MockWebUIDataSource : public content::URLDataSourceDelegate {
public:
- MockWebUIDataSource()
- : ChromeURLDataManager::DataSource("dummyurl", MessageLoop::current()) {}
+ MockWebUIDataSource() {}
private:
virtual ~MockWebUIDataSource() {}
+ virtual std::string GetSource() OVERRIDE {
+ return "dummyurl";
+ }
+
virtual void StartDataRequest(const std::string& path,
bool is_incognito,
int request_id) OVERRIDE {
std::string dummy_html = "<html><body>Dummy</body></html>";
scoped_refptr<base::RefCountedString> response =
base::RefCountedString::TakeString(&dummy_html);
- SendResponse(request_id, response);
+ url_data_source()->SendResponse(request_id, response);
}
std::string GetMimeType(const std::string& path) const OVERRIDE {

Powered by Google App Engine
This is Rietveld 408576698