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

Unified Diff: components/dom_distiller/core/viewer_unittest.cc

Issue 235833003: Move helper utilities for the DOM Distiller Viewer to core. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed iOS grit whitelist Created 6 years, 8 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
« no previous file with comments | « components/dom_distiller/core/viewer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/dom_distiller/core/viewer_unittest.cc
diff --git a/components/dom_distiller/content/dom_distiller_viewer_source_unittest.cc b/components/dom_distiller/core/viewer_unittest.cc
similarity index 79%
copy from components/dom_distiller/content/dom_distiller_viewer_source_unittest.cc
copy to components/dom_distiller/core/viewer_unittest.cc
index 7e5db1978cb7afc0a006fced826a487639d3c2e8..66af2eda94008008327adc1e238ace234e07ca47 100644
--- a/components/dom_distiller/content/dom_distiller_viewer_source_unittest.cc
+++ b/components/dom_distiller/core/viewer_unittest.cc
@@ -2,18 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "components/dom_distiller/content/dom_distiller_viewer_source.h"
+#include "components/dom_distiller/core/viewer.h"
-#include <vector>
-
-#include "base/callback.h"
-#include "components/dom_distiller/core/article_distillation_update.h"
-#include "components/dom_distiller/core/article_entry.h"
#include "components/dom_distiller/core/dom_distiller_service.h"
-#include "components/dom_distiller/core/dom_distiller_store.h"
#include "components/dom_distiller/core/dom_distiller_test_util.h"
-#include "components/dom_distiller/core/fake_db.h"
-#include "components/dom_distiller/core/fake_distiller.h"
#include "components/dom_distiller/core/task_tracker.h"
#include "components/dom_distiller/core/url_constants.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -56,30 +48,24 @@ class TestDomDistillerService : public DomDistillerServiceInterface {
}
};
-class DomDistillerViewerSourceTest : public testing::Test {
+class DomDistillerViewerTest : public testing::Test {
public:
virtual void SetUp() OVERRIDE {
service_.reset(new TestDomDistillerService());
- source_.reset(new DomDistillerViewerSource(service_.get(), kTestScheme));
}
protected:
scoped_ptr<ViewerHandle> CreateViewRequest(
const std::string& path,
ViewRequestDelegate* view_request_delegate) {
- return source_.get()->CreateViewRequest(path, view_request_delegate);
+ return viewer::CreateViewRequest(
+ service_.get(), path, view_request_delegate);
}
scoped_ptr<TestDomDistillerService> service_;
- scoped_ptr<DomDistillerViewerSource> source_;
};
-TEST_F(DomDistillerViewerSourceTest, TestMimeType) {
- EXPECT_EQ("text/css", source_.get()->GetMimeType(kCssPath));
- EXPECT_EQ("text/html", source_.get()->GetMimeType("anythingelse"));
-}
-
-TEST_F(DomDistillerViewerSourceTest, TestCreatingViewUrlRequest) {
+TEST_F(DomDistillerViewerTest, TestCreatingViewUrlRequest) {
scoped_ptr<FakeViewRequestDelegate> view_request_delegate(
new FakeViewRequestDelegate());
ViewerHandle* viewer_handle(new ViewerHandle(ViewerHandle::CancelCallback()));
@@ -91,7 +77,7 @@ TEST_F(DomDistillerViewerSourceTest, TestCreatingViewUrlRequest) {
view_request_delegate.get());
}
-TEST_F(DomDistillerViewerSourceTest, TestCreatingViewEntryRequest) {
+TEST_F(DomDistillerViewerTest, TestCreatingViewEntryRequest) {
scoped_ptr<FakeViewRequestDelegate> view_request_delegate(
new FakeViewRequestDelegate());
ViewerHandle* viewer_handle(new ViewerHandle(ViewerHandle::CancelCallback()));
@@ -102,7 +88,7 @@ TEST_F(DomDistillerViewerSourceTest, TestCreatingViewEntryRequest) {
view_request_delegate.get());
}
-TEST_F(DomDistillerViewerSourceTest, TestCreatingInvalidViewRequest) {
+TEST_F(DomDistillerViewerTest, TestCreatingInvalidViewRequest) {
scoped_ptr<FakeViewRequestDelegate> view_request_delegate(
new FakeViewRequestDelegate());
EXPECT_CALL(*service_.get(), ViewEntryImpl()).Times(0);
« no previous file with comments | « components/dom_distiller/core/viewer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698