| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 | 75 |
| 76 class DomDistillerViewerSourceBrowserTest : public InProcessBrowserTest { | 76 class DomDistillerViewerSourceBrowserTest : public InProcessBrowserTest { |
| 77 public: | 77 public: |
| 78 DomDistillerViewerSourceBrowserTest() {} | 78 DomDistillerViewerSourceBrowserTest() {} |
| 79 virtual ~DomDistillerViewerSourceBrowserTest() {} | 79 virtual ~DomDistillerViewerSourceBrowserTest() {} |
| 80 | 80 |
| 81 virtual void SetUpOnMainThread() OVERRIDE { | 81 virtual void SetUpOnMainThread() OVERRIDE { |
| 82 database_model_ = new FakeDB<ArticleEntry>::EntryMap; | 82 database_model_ = new FakeDB<ArticleEntry>::EntryMap; |
| 83 } | 83 } |
| 84 | 84 |
| 85 virtual void CleanUpOnMainThread() OVERRIDE { delete database_model_; } | 85 virtual void TearDownOnMainThread() OVERRIDE { delete database_model_; } |
| 86 | 86 |
| 87 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 87 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 88 command_line->AppendSwitch(switches::kEnableDomDistiller); | 88 command_line->AppendSwitch(switches::kEnableDomDistiller); |
| 89 } | 89 } |
| 90 | 90 |
| 91 static KeyedService* Build(content::BrowserContext* context) { | 91 static KeyedService* Build(content::BrowserContext* context) { |
| 92 FakeDB<ArticleEntry>* fake_db = new FakeDB<ArticleEntry>(database_model_); | 92 FakeDB<ArticleEntry>* fake_db = new FakeDB<ArticleEntry>(database_model_); |
| 93 distiller_factory_ = new MockDistillerFactory(); | 93 distiller_factory_ = new MockDistillerFactory(); |
| 94 MockDistillerPageFactory* distiller_page_factory_ = | 94 MockDistillerPageFactory* distiller_page_factory_ = |
| 95 new MockDistillerPageFactory(); | 95 new MockDistillerPageFactory(); |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 EXPECT_TRUE(content::ExecuteScriptAndExtractString( | 315 EXPECT_TRUE(content::ExecuteScriptAndExtractString( |
| 316 contents, kGetLoadIndicatorClassName, &result)); | 316 contents, kGetLoadIndicatorClassName, &result)); |
| 317 EXPECT_EQ("hidden", result); | 317 EXPECT_EQ("hidden", result); |
| 318 EXPECT_TRUE(content::ExecuteScriptAndExtractString( | 318 EXPECT_TRUE(content::ExecuteScriptAndExtractString( |
| 319 contents, kGetContent , &result)); | 319 contents, kGetContent , &result)); |
| 320 EXPECT_THAT(result, HasSubstr("Page 1 content")); | 320 EXPECT_THAT(result, HasSubstr("Page 1 content")); |
| 321 EXPECT_THAT(result, HasSubstr("Page 2 content")); | 321 EXPECT_THAT(result, HasSubstr("Page 2 content")); |
| 322 } | 322 } |
| 323 | 323 |
| 324 } // namespace dom_distiller | 324 } // namespace dom_distiller |
| OLD | NEW |