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 <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 | 162 |
163 FakeDB<ArticleEntry>::EntryMap* | 163 FakeDB<ArticleEntry>::EntryMap* |
164 DomDistillerViewerSourceBrowserTest::database_model_; | 164 DomDistillerViewerSourceBrowserTest::database_model_; |
165 bool DomDistillerViewerSourceBrowserTest::expect_distillation_ = false; | 165 bool DomDistillerViewerSourceBrowserTest::expect_distillation_ = false; |
166 bool DomDistillerViewerSourceBrowserTest::expect_distiller_page_ = false; | 166 bool DomDistillerViewerSourceBrowserTest::expect_distiller_page_ = false; |
167 MockDistillerFactory* DomDistillerViewerSourceBrowserTest::distiller_factory_ = | 167 MockDistillerFactory* DomDistillerViewerSourceBrowserTest::distiller_factory_ = |
168 NULL; | 168 NULL; |
169 | 169 |
170 // The DomDistillerViewerSource renders untrusted content, so ensure no bindings | 170 // The DomDistillerViewerSource renders untrusted content, so ensure no bindings |
171 // are enabled when the article exists in the database. | 171 // are enabled when the article exists in the database. |
| 172 // Flaky on Linux Debug, see http://crbug.com/605432. |
| 173 #if defined(OS_LINUX) && !defined(NDEBUG) |
| 174 #define MAYBE_NoWebUIBindingsArticleExists DISABLED_NoWebUIBindingsArticleExists |
| 175 #else |
| 176 #define MAYBE_NoWebUIBindingsArticleExists NoWebUIBindingsArticleExists |
| 177 #endif |
172 IN_PROC_BROWSER_TEST_F(DomDistillerViewerSourceBrowserTest, | 178 IN_PROC_BROWSER_TEST_F(DomDistillerViewerSourceBrowserTest, |
173 NoWebUIBindingsArticleExists) { | 179 MAYBE_NoWebUIBindingsArticleExists) { |
174 // Ensure there is one item in the database, which will trigger distillation. | 180 // Ensure there is one item in the database, which will trigger distillation. |
175 const ArticleEntry entry = CreateEntry("DISTILLED", "http://example.com/1"); | 181 const ArticleEntry entry = CreateEntry("DISTILLED", "http://example.com/1"); |
176 AddEntry(entry, database_model_); | 182 AddEntry(entry, database_model_); |
177 expect_distillation_ = true; | 183 expect_distillation_ = true; |
178 expect_distiller_page_ = true; | 184 expect_distiller_page_ = true; |
179 const GURL url = url_utils::GetDistillerViewUrlFromEntryId( | 185 const GURL url = url_utils::GetDistillerViewUrlFromEntryId( |
180 kDomDistillerScheme, entry.entry_id()); | 186 kDomDistillerScheme, entry.entry_id()); |
181 ViewSingleDistilledPage(url, "text/html"); | 187 ViewSingleDistilledPage(url, "text/html"); |
182 } | 188 } |
183 | 189 |
184 // The DomDistillerViewerSource renders untrusted content, so ensure no bindings | 190 // The DomDistillerViewerSource renders untrusted content, so ensure no bindings |
185 // are enabled when the article is not found. | 191 // are enabled when the article is not found. |
| 192 // Flaky on Linux Debug, see http://crbug.com/605432. |
| 193 #if defined(OS_LINUX) && !defined(NDEBUG) |
| 194 #define MAYBE_NoWebUIBindingsArticleNotFound DISABLED_NoWebUIBindingsArticleNotF
ound |
| 195 #else |
| 196 #define MAYBE_NoWebUIBindingsArticleNotFound NoWebUIBindingsArticleNotFound |
| 197 #endif |
186 IN_PROC_BROWSER_TEST_F(DomDistillerViewerSourceBrowserTest, | 198 IN_PROC_BROWSER_TEST_F(DomDistillerViewerSourceBrowserTest, |
187 NoWebUIBindingsArticleNotFound) { | 199 MAYBE_NoWebUIBindingsArticleNotFound) { |
188 // The article does not exist, so assume no distillation will happen. | 200 // The article does not exist, so assume no distillation will happen. |
189 expect_distillation_ = false; | 201 expect_distillation_ = false; |
190 expect_distiller_page_ = false; | 202 expect_distiller_page_ = false; |
191 const GURL url = url_utils::GetDistillerViewUrlFromEntryId( | 203 const GURL url = url_utils::GetDistillerViewUrlFromEntryId( |
192 kDomDistillerScheme, "DOES_NOT_EXIST"); | 204 kDomDistillerScheme, "DOES_NOT_EXIST"); |
193 ViewSingleDistilledPage(url, "text/html"); | 205 ViewSingleDistilledPage(url, "text/html"); |
194 } | 206 } |
195 | 207 |
196 // The DomDistillerViewerSource renders untrusted content, so ensure no bindings | 208 // The DomDistillerViewerSource renders untrusted content, so ensure no bindings |
197 // are enabled when requesting to view an arbitrary URL. | 209 // are enabled when requesting to view an arbitrary URL. |
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
633 EXPECT_EQ("dark serif", result); | 645 EXPECT_EQ("dark serif", result); |
634 EXPECT_EQ(kDarkToolbarThemeColor, contents->GetThemeColor()); | 646 EXPECT_EQ(kDarkToolbarThemeColor, contents->GetThemeColor()); |
635 | 647 |
636 EXPECT_TRUE(content::ExecuteScriptAndExtractString( | 648 EXPECT_TRUE(content::ExecuteScriptAndExtractString( |
637 contents, kGetFontSize, &result)); | 649 contents, kGetFontSize, &result)); |
638 base::StringToDouble(result, &fontSize); | 650 base::StringToDouble(result, &fontSize); |
639 ASSERT_FLOAT_EQ(kScale, fontSize/oldFontSize); | 651 ASSERT_FLOAT_EQ(kScale, fontSize/oldFontSize); |
640 } | 652 } |
641 | 653 |
642 } // namespace dom_distiller | 654 } // namespace dom_distiller |
OLD | NEW |