OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "components/dom_distiller/core/dom_distiller_service.h" | 5 #include "components/dom_distiller/core/dom_distiller_service.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/containers/hash_tables.h" | 9 #include "base/containers/hash_tables.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 } | 58 } |
59 | 59 |
60 } // namespace | 60 } // namespace |
61 | 61 |
62 class DomDistillerServiceTest : public testing::Test { | 62 class DomDistillerServiceTest : public testing::Test { |
63 public: | 63 public: |
64 virtual void SetUp() { | 64 virtual void SetUp() { |
65 main_loop_.reset(new base::MessageLoop()); | 65 main_loop_.reset(new base::MessageLoop()); |
66 FakeDB* fake_db = new FakeDB(&db_model_); | 66 FakeDB* fake_db = new FakeDB(&db_model_); |
67 FakeDB::EntryMap store_model; | 67 FakeDB::EntryMap store_model; |
68 store_ = test::util::CreateStoreWithFakeDB(fake_db, &store_model); | 68 store_ = test::util::CreateStoreWithFakeDB(fake_db, store_model); |
69 distiller_factory_ = new MockDistillerFactory(); | 69 distiller_factory_ = new MockDistillerFactory(); |
70 service_.reset(new DomDistillerService( | 70 service_.reset(new DomDistillerService( |
71 scoped_ptr<DomDistillerStoreInterface>(store_), | 71 scoped_ptr<DomDistillerStoreInterface>(store_), |
72 scoped_ptr<DistillerFactory>(distiller_factory_))); | 72 scoped_ptr<DistillerFactory>(distiller_factory_))); |
73 fake_db->InitCallback(true); | 73 fake_db->InitCallback(true); |
74 fake_db->LoadCallback(true); | 74 fake_db->LoadCallback(true); |
75 } | 75 } |
76 | 76 |
77 virtual void TearDown() { | 77 virtual void TearDown() { |
78 base::RunLoop().RunUntilIdle(); | 78 base::RunLoop().RunUntilIdle(); |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 service_->AddToList(url, ArticleCallback(&article_cb[i]))); | 348 service_->AddToList(url, ArticleCallback(&article_cb[i]))); |
349 EXPECT_CALL(article_cb[i], DistillationCompleted(false)); | 349 EXPECT_CALL(article_cb[i], DistillationCompleted(false)); |
350 } | 350 } |
351 | 351 |
352 service_->RemoveEntry(entry_id); | 352 service_->RemoveEntry(entry_id); |
353 base::RunLoop().RunUntilIdle(); | 353 base::RunLoop().RunUntilIdle(); |
354 } | 354 } |
355 | 355 |
356 } // namespace test | 356 } // namespace test |
357 } // namespace dom_distiller | 357 } // namespace dom_distiller |
OLD | NEW |