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/task_tracker.h" | 5 #include "components/dom_distiller/core/task_tracker.h" |
6 | 6 |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "components/dom_distiller/core/article_distillation_update.h" | 8 #include "components/dom_distiller/core/article_distillation_update.h" |
9 #include "components/dom_distiller/core/article_entry.h" | 9 #include "components/dom_distiller/core/article_entry.h" |
10 #include "components/dom_distiller/core/distilled_content_store.h" | 10 #include "components/dom_distiller/core/distilled_content_store.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 }; | 50 }; |
51 | 51 |
52 class MockSaveCallback { | 52 class MockSaveCallback { |
53 public: | 53 public: |
54 MOCK_METHOD3(Save, | 54 MOCK_METHOD3(Save, |
55 void(const ArticleEntry&, const DistilledArticleProto*, bool)); | 55 void(const ArticleEntry&, const DistilledArticleProto*, bool)); |
56 }; | 56 }; |
57 | 57 |
58 class DomDistillerTaskTrackerTest : public testing::Test { | 58 class DomDistillerTaskTrackerTest : public testing::Test { |
59 public: | 59 public: |
60 virtual void SetUp() OVERRIDE { | 60 virtual void SetUp() override { |
61 message_loop_.reset(new base::MessageLoop()); | 61 message_loop_.reset(new base::MessageLoop()); |
62 entry_id_ = "id0"; | 62 entry_id_ = "id0"; |
63 page_0_url_ = GURL("http://www.example.com/1"); | 63 page_0_url_ = GURL("http://www.example.com/1"); |
64 page_1_url_ = GURL("http://www.example.com/2"); | 64 page_1_url_ = GURL("http://www.example.com/2"); |
65 } | 65 } |
66 | 66 |
67 ArticleEntry GetDefaultEntry() { | 67 ArticleEntry GetDefaultEntry() { |
68 ArticleEntry entry; | 68 ArticleEntry entry; |
69 entry.set_entry_id(entry_id_); | 69 entry.set_entry_id(entry_id_); |
70 ArticleEntryPage* page0 = entry.add_pages(); | 70 ArticleEntryPage* page0 = entry.add_pages(); |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 new DistilledArticleProto(distilled_article))); | 394 new DistilledArticleProto(distilled_article))); |
395 base::RunLoop().RunUntilIdle(); | 395 base::RunLoop().RunUntilIdle(); |
396 | 396 |
397 ASSERT_EQ(stored_distilled_article.SerializeAsString(), | 397 ASSERT_EQ(stored_distilled_article.SerializeAsString(), |
398 distilled_article.SerializeAsString()); | 398 distilled_article.SerializeAsString()); |
399 EXPECT_FALSE(cancel_callback.Cancelled()); | 399 EXPECT_FALSE(cancel_callback.Cancelled()); |
400 } | 400 } |
401 | 401 |
402 } // namespace test | 402 } // namespace test |
403 } // namespace dom_distiller | 403 } // namespace dom_distiller |
OLD | NEW |