OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <string.h> | 5 #include <string.h> |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/guid.h" | 8 #include "base/guid.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/browser/dom_distiller/dom_distiller_service_factory.h" | 10 #include "chrome/browser/dom_distiller/dom_distiller_service_factory.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 public: | 80 public: |
81 DomDistillerViewerSourceBrowserTest() {} | 81 DomDistillerViewerSourceBrowserTest() {} |
82 ~DomDistillerViewerSourceBrowserTest() override {} | 82 ~DomDistillerViewerSourceBrowserTest() override {} |
83 | 83 |
84 void SetUpOnMainThread() override { | 84 void SetUpOnMainThread() override { |
85 database_model_ = new FakeDB<ArticleEntry>::EntryMap; | 85 database_model_ = new FakeDB<ArticleEntry>::EntryMap; |
86 } | 86 } |
87 | 87 |
88 void TearDownOnMainThread() override { delete database_model_; } | 88 void TearDownOnMainThread() override { delete database_model_; } |
89 | 89 |
90 void SetUpCommandLine(CommandLine* command_line) override { | 90 void SetUpCommandLine(base::CommandLine* command_line) override { |
91 command_line->AppendSwitch(switches::kEnableDomDistiller); | 91 command_line->AppendSwitch(switches::kEnableDomDistiller); |
92 } | 92 } |
93 | 93 |
94 static KeyedService* Build(content::BrowserContext* context) { | 94 static KeyedService* Build(content::BrowserContext* context) { |
95 FakeDB<ArticleEntry>* fake_db = new FakeDB<ArticleEntry>(database_model_); | 95 FakeDB<ArticleEntry>* fake_db = new FakeDB<ArticleEntry>(database_model_); |
96 distiller_factory_ = new MockDistillerFactory(); | 96 distiller_factory_ = new MockDistillerFactory(); |
97 MockDistillerPageFactory* distiller_page_factory_ = | 97 MockDistillerPageFactory* distiller_page_factory_ = |
98 new MockDistillerPageFactory(); | 98 new MockDistillerPageFactory(); |
99 DomDistillerContextKeyedService* service = | 99 DomDistillerContextKeyedService* service = |
100 new DomDistillerContextKeyedService( | 100 new DomDistillerContextKeyedService( |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 EXPECT_EQ("dark sans-serif", result); | 354 EXPECT_EQ("dark sans-serif", result); |
355 | 355 |
356 distilled_page_prefs->SetFontFamily(DistilledPagePrefs::SERIF); | 356 distilled_page_prefs->SetFontFamily(DistilledPagePrefs::SERIF); |
357 base::RunLoop().RunUntilIdle(); | 357 base::RunLoop().RunUntilIdle(); |
358 EXPECT_TRUE( | 358 EXPECT_TRUE( |
359 content::ExecuteScriptAndExtractString(contents, kGetBodyClass, &result)); | 359 content::ExecuteScriptAndExtractString(contents, kGetBodyClass, &result)); |
360 EXPECT_EQ("dark serif", result); | 360 EXPECT_EQ("dark serif", result); |
361 } | 361 } |
362 | 362 |
363 } // namespace dom_distiller | 363 } // namespace dom_distiller |
OLD | NEW |