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/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 const char kGetBodyClass[] = | 64 const char kGetBodyClass[] = |
65 "window.domAutomationController.send(" | 65 "window.domAutomationController.send(" |
66 "document.body.className)"; | 66 "document.body.className)"; |
67 | 67 |
68 const unsigned kDarkToolbarThemeColor = 0xFF1A1A1A; | 68 const unsigned kDarkToolbarThemeColor = 0xFF1A1A1A; |
69 | 69 |
70 void AddEntry(const ArticleEntry& e, FakeDB<ArticleEntry>::EntryMap* map) { | 70 void AddEntry(const ArticleEntry& e, FakeDB<ArticleEntry>::EntryMap* map) { |
71 (*map)[e.entry_id()] = e; | 71 (*map)[e.entry_id()] = e; |
72 } | 72 } |
73 | 73 |
74 ArticleEntry CreateEntry(std::string entry_id, std::string page_url) { | 74 ArticleEntry CreateEntry(const std::string& entry_id, |
| 75 const std::string& page_url) { |
75 ArticleEntry entry; | 76 ArticleEntry entry; |
76 entry.set_entry_id(entry_id); | 77 entry.set_entry_id(entry_id); |
77 if (!page_url.empty()) { | 78 if (!page_url.empty()) { |
78 ArticleEntryPage* page = entry.add_pages(); | 79 ArticleEntryPage* page = entry.add_pages(); |
79 page->set_url(page_url); | 80 page->set_url(page_url); |
80 } | 81 } |
81 return entry; | 82 return entry; |
82 } | 83 } |
83 | 84 |
84 } // namespace | 85 } // namespace |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 EXPECT_EQ(kDarkToolbarThemeColor, contents->GetThemeColor()); | 446 EXPECT_EQ(kDarkToolbarThemeColor, contents->GetThemeColor()); |
446 | 447 |
447 distilled_page_prefs->SetFontFamily(DistilledPagePrefs::SERIF); | 448 distilled_page_prefs->SetFontFamily(DistilledPagePrefs::SERIF); |
448 base::RunLoop().RunUntilIdle(); | 449 base::RunLoop().RunUntilIdle(); |
449 EXPECT_TRUE( | 450 EXPECT_TRUE( |
450 content::ExecuteScriptAndExtractString(contents, kGetBodyClass, &result)); | 451 content::ExecuteScriptAndExtractString(contents, kGetBodyClass, &result)); |
451 EXPECT_EQ("dark serif", result); | 452 EXPECT_EQ("dark serif", result); |
452 } | 453 } |
453 | 454 |
454 } // namespace dom_distiller | 455 } // namespace dom_distiller |
OLD | NEW |