| 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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 EXPECT_CALL(*distiller_factory_, CreateDistillerImpl()) | 248 EXPECT_CALL(*distiller_factory_, CreateDistillerImpl()) |
| 249 .WillOnce(testing::Return(distiller)); | 249 .WillOnce(testing::Return(distiller)); |
| 250 | 250 |
| 251 // Setup observer to inspect the RenderViewHost after committed navigation. | 251 // Setup observer to inspect the RenderViewHost after committed navigation. |
| 252 content::WebContents* contents = | 252 content::WebContents* contents = |
| 253 browser()->tab_strip_model()->GetActiveWebContents(); | 253 browser()->tab_strip_model()->GetActiveWebContents(); |
| 254 | 254 |
| 255 // Navigate to a URL and wait for the distiller to flush contents to the page. | 255 // Navigate to a URL and wait for the distiller to flush contents to the page. |
| 256 GURL url(dom_distiller::url_utils::GetDistillerViewUrlFromUrl( | 256 GURL url(dom_distiller::url_utils::GetDistillerViewUrlFromUrl( |
| 257 kDomDistillerScheme, GURL("http://urlthatlooksvalid.com"))); | 257 kDomDistillerScheme, GURL("http://urlthatlooksvalid.com"))); |
| 258 chrome::NavigateParams params(browser(), url, content::PAGE_TRANSITION_TYPED); | 258 chrome::NavigateParams params(browser(), url, ui::PAGE_TRANSITION_TYPED); |
| 259 chrome::Navigate(¶ms); | 259 chrome::Navigate(¶ms); |
| 260 distillation_done_runner->Run(); | 260 distillation_done_runner->Run(); |
| 261 | 261 |
| 262 // Fake a multi-page response from distiller. | 262 // Fake a multi-page response from distiller. |
| 263 | 263 |
| 264 std::vector<scoped_refptr<ArticleDistillationUpdate::RefCountedPageProto> > | 264 std::vector<scoped_refptr<ArticleDistillationUpdate::RefCountedPageProto> > |
| 265 update_pages; | 265 update_pages; |
| 266 scoped_ptr<DistilledArticleProto> article(new DistilledArticleProto()); | 266 scoped_ptr<DistilledArticleProto> article(new DistilledArticleProto()); |
| 267 | 267 |
| 268 // Flush page 1. | 268 // Flush page 1. |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 EXPECT_EQ("dark sans-serif", result); | 355 EXPECT_EQ("dark sans-serif", result); |
| 356 | 356 |
| 357 distilled_page_prefs->SetFontFamily(DistilledPagePrefs::SERIF); | 357 distilled_page_prefs->SetFontFamily(DistilledPagePrefs::SERIF); |
| 358 base::RunLoop().RunUntilIdle(); | 358 base::RunLoop().RunUntilIdle(); |
| 359 EXPECT_TRUE( | 359 EXPECT_TRUE( |
| 360 content::ExecuteScriptAndExtractString(contents, kGetBodyClass, &result)); | 360 content::ExecuteScriptAndExtractString(contents, kGetBodyClass, &result)); |
| 361 EXPECT_EQ("dark serif", result); | 361 EXPECT_EQ("dark serif", result); |
| 362 } | 362 } |
| 363 | 363 |
| 364 } // namespace dom_distiller | 364 } // namespace dom_distiller |
| OLD | NEW |