| 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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 // The article does not exist, so assume no distillation will happen. | 200 // The article does not exist, so assume no distillation will happen. |
| 201 expect_distillation_ = false; | 201 expect_distillation_ = false; |
| 202 expect_distiller_page_ = false; | 202 expect_distiller_page_ = false; |
| 203 const GURL url = url_utils::GetDistillerViewUrlFromEntryId( | 203 const GURL url = url_utils::GetDistillerViewUrlFromEntryId( |
| 204 kDomDistillerScheme, "DOES_NOT_EXIST"); | 204 kDomDistillerScheme, "DOES_NOT_EXIST"); |
| 205 ViewSingleDistilledPage(url, "text/html"); | 205 ViewSingleDistilledPage(url, "text/html"); |
| 206 } | 206 } |
| 207 | 207 |
| 208 // The DomDistillerViewerSource renders untrusted content, so ensure no bindings | 208 // The DomDistillerViewerSource renders untrusted content, so ensure no bindings |
| 209 // are enabled when requesting to view an arbitrary URL. | 209 // are enabled when requesting to view an arbitrary URL. |
| 210 // Flaky on Linux: see http://crbug.com/606040. |
| 211 #if defined(OS_LINUX) |
| 212 #define MAYBE_NoWebUIBindingsViewUrl DISABLED_NoWebUIBindingsViewUrl |
| 213 #else |
| 214 #define MAYBE_NoWebUIBindingsViewUrl NoWebUIBindingsViewUrl |
| 215 #endif |
| 210 IN_PROC_BROWSER_TEST_F(DomDistillerViewerSourceBrowserTest, | 216 IN_PROC_BROWSER_TEST_F(DomDistillerViewerSourceBrowserTest, |
| 211 NoWebUIBindingsViewUrl) { | 217 MAYBE_NoWebUIBindingsViewUrl) { |
| 212 // We should expect distillation for any valid URL. | 218 // We should expect distillation for any valid URL. |
| 213 expect_distillation_ = true; | 219 expect_distillation_ = true; |
| 214 expect_distiller_page_ = true; | 220 expect_distiller_page_ = true; |
| 215 GURL view_url("http://www.example.com/1"); | 221 GURL view_url("http://www.example.com/1"); |
| 216 const GURL url = | 222 const GURL url = |
| 217 url_utils::GetDistillerViewUrlFromUrl(kDomDistillerScheme, view_url); | 223 url_utils::GetDistillerViewUrlFromUrl(kDomDistillerScheme, view_url); |
| 218 ViewSingleDistilledPage(url, "text/html"); | 224 ViewSingleDistilledPage(url, "text/html"); |
| 219 } | 225 } |
| 220 | 226 |
| 221 void DomDistillerViewerSourceBrowserTest::ViewSingleDistilledPage( | 227 void DomDistillerViewerSourceBrowserTest::ViewSingleDistilledPage( |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 645 EXPECT_EQ("dark serif", result); | 651 EXPECT_EQ("dark serif", result); |
| 646 EXPECT_EQ(kDarkToolbarThemeColor, contents->GetThemeColor()); | 652 EXPECT_EQ(kDarkToolbarThemeColor, contents->GetThemeColor()); |
| 647 | 653 |
| 648 EXPECT_TRUE(content::ExecuteScriptAndExtractString( | 654 EXPECT_TRUE(content::ExecuteScriptAndExtractString( |
| 649 contents, kGetFontSize, &result)); | 655 contents, kGetFontSize, &result)); |
| 650 base::StringToDouble(result, &fontSize); | 656 base::StringToDouble(result, &fontSize); |
| 651 ASSERT_FLOAT_EQ(kScale, fontSize/oldFontSize); | 657 ASSERT_FLOAT_EQ(kScale, fontSize/oldFontSize); |
| 652 } | 658 } |
| 653 | 659 |
| 654 } // namespace dom_distiller | 660 } // namespace dom_distiller |
| OLD | NEW |