| 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/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 | 80 |
| 81 class DomDistillerViewerSourceBrowserTest : public InProcessBrowserTest { | 81 class DomDistillerViewerSourceBrowserTest : public InProcessBrowserTest { |
| 82 public: | 82 public: |
| 83 DomDistillerViewerSourceBrowserTest() {} | 83 DomDistillerViewerSourceBrowserTest() {} |
| 84 virtual ~DomDistillerViewerSourceBrowserTest() {} | 84 virtual ~DomDistillerViewerSourceBrowserTest() {} |
| 85 | 85 |
| 86 virtual void SetUpOnMainThread() OVERRIDE { | 86 virtual void SetUpOnMainThread() OVERRIDE { |
| 87 database_model_ = new FakeDB<ArticleEntry>::EntryMap; | 87 database_model_ = new FakeDB<ArticleEntry>::EntryMap; |
| 88 } | 88 } |
| 89 | 89 |
| 90 virtual void CleanUpOnMainThread() OVERRIDE { delete database_model_; } | 90 virtual void TearDownOnMainThread() OVERRIDE { delete database_model_; } |
| 91 | 91 |
| 92 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 92 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 93 command_line->AppendSwitch(switches::kEnableDomDistiller); | 93 command_line->AppendSwitch(switches::kEnableDomDistiller); |
| 94 } | 94 } |
| 95 | 95 |
| 96 static KeyedService* Build(content::BrowserContext* context) { | 96 static KeyedService* Build(content::BrowserContext* context) { |
| 97 FakeDB<ArticleEntry>* fake_db = new FakeDB<ArticleEntry>(database_model_); | 97 FakeDB<ArticleEntry>* fake_db = new FakeDB<ArticleEntry>(database_model_); |
| 98 distiller_factory_ = new MockDistillerFactory(); | 98 distiller_factory_ = new MockDistillerFactory(); |
| 99 MockDistillerPageFactory* distiller_page_factory_ = | 99 MockDistillerPageFactory* distiller_page_factory_ = |
| 100 new MockDistillerPageFactory(); | 100 new MockDistillerPageFactory(); |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 browser()->profile())->GetDistilledPagePrefs(); | 351 browser()->profile())->GetDistilledPagePrefs(); |
| 352 | 352 |
| 353 distilled_page_prefs->SetTheme(DistilledPagePrefs::DARK); | 353 distilled_page_prefs->SetTheme(DistilledPagePrefs::DARK); |
| 354 base::RunLoop().RunUntilIdle(); | 354 base::RunLoop().RunUntilIdle(); |
| 355 EXPECT_TRUE(content::ExecuteScriptAndExtractString( | 355 EXPECT_TRUE(content::ExecuteScriptAndExtractString( |
| 356 contents, kGetBodyClass, &result)); | 356 contents, kGetBodyClass, &result)); |
| 357 EXPECT_EQ("dark", result); | 357 EXPECT_EQ("dark", result); |
| 358 } | 358 } |
| 359 | 359 |
| 360 } // namespace dom_distiller | 360 } // namespace dom_distiller |
| OLD | NEW |