OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <stddef.h> | 5 #include <stddef.h> |
6 #include <utility> | 6 #include <utility> |
7 | 7 |
8 #include "base/base64.h" | 8 #include "base/base64.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/json/json_reader.h" | 12 #include "base/json/json_reader.h" |
13 #include "base/json/json_writer.h" | 13 #include "base/json/json_writer.h" |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "base/memory/ptr_util.h" | 15 #include "base/memory/ptr_util.h" |
16 #include "base/run_loop.h" | 16 #include "base/run_loop.h" |
17 #include "base/strings/stringprintf.h" | 17 #include "base/strings/stringprintf.h" |
18 #include "base/strings/utf_string_conversions.h" | 18 #include "base/strings/utf_string_conversions.h" |
| 19 #include "base/sys_info.h" |
19 #include "base/values.h" | 20 #include "base/values.h" |
20 #include "build/build_config.h" | 21 #include "build/build_config.h" |
21 #include "content/browser/frame_host/interstitial_page_impl.h" | 22 #include "content/browser/frame_host/interstitial_page_impl.h" |
22 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 23 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
23 #include "content/browser/web_contents/web_contents_impl.h" | 24 #include "content/browser/web_contents/web_contents_impl.h" |
24 #include "content/public/browser/devtools_agent_host.h" | 25 #include "content/public/browser/devtools_agent_host.h" |
25 #include "content/public/browser/interstitial_page_delegate.h" | 26 #include "content/public/browser/interstitial_page_delegate.h" |
26 #include "content/public/browser/javascript_dialog_manager.h" | 27 #include "content/public/browser/javascript_dialog_manager.h" |
27 #include "content/public/browser/navigation_controller.h" | 28 #include "content/public/browser/navigation_controller.h" |
28 #include "content/public/browser/navigation_entry.h" | 29 #include "content/public/browser/navigation_entry.h" |
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
565 | 566 |
566 private: | 567 private: |
567 #if !defined(OS_ANDROID) | 568 #if !defined(OS_ANDROID) |
568 void SetUpCommandLine(base::CommandLine* command_line) override { | 569 void SetUpCommandLine(base::CommandLine* command_line) override { |
569 command_line->AppendSwitch(switches::kEnablePixelOutputInTests); | 570 command_line->AppendSwitch(switches::kEnablePixelOutputInTests); |
570 } | 571 } |
571 #endif | 572 #endif |
572 }; | 573 }; |
573 | 574 |
574 IN_PROC_BROWSER_TEST_F(CaptureScreenshotTest, CaptureScreenshot) { | 575 IN_PROC_BROWSER_TEST_F(CaptureScreenshotTest, CaptureScreenshot) { |
| 576 // This test fails consistently on low-end Android devices. |
| 577 // See crbug.com/653637. |
| 578 if (base::SysInfo::IsLowEndDevice()) return; |
| 579 |
575 shell()->LoadURL(GURL("about:blank")); | 580 shell()->LoadURL(GURL("about:blank")); |
576 Attach(); | 581 Attach(); |
577 EXPECT_TRUE( | 582 EXPECT_TRUE( |
578 content::ExecuteScript(shell()->web_contents()->GetRenderViewHost(), | 583 content::ExecuteScript(shell()->web_contents()->GetRenderViewHost(), |
579 "document.body.style.background = '#123456'")); | 584 "document.body.style.background = '#123456'")); |
580 SkBitmap expected_bitmap; | 585 SkBitmap expected_bitmap; |
581 // We compare against the actual physical backing size rather than the | 586 // We compare against the actual physical backing size rather than the |
582 // view size, because the view size is stored adjusted for DPI and only in | 587 // view size, because the view size is stored adjusted for DPI and only in |
583 // integer precision. | 588 // integer precision. |
584 gfx::Size view_size = static_cast<RenderWidgetHostViewBase*>( | 589 gfx::Size view_size = static_cast<RenderWidgetHostViewBase*>( |
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1206 ASSERT_TRUE(transient_entry); | 1211 ASSERT_TRUE(transient_entry); |
1207 transient_entry->GetSSL().certificate = expired_cert(); | 1212 transient_entry->GetSSL().certificate = expired_cert(); |
1208 ASSERT_TRUE(transient_entry->GetSSL().certificate); | 1213 ASSERT_TRUE(transient_entry->GetSSL().certificate); |
1209 | 1214 |
1210 std::unique_ptr<base::DictionaryValue> params2(new base::DictionaryValue()); | 1215 std::unique_ptr<base::DictionaryValue> params2(new base::DictionaryValue()); |
1211 SendCommand("Security.showCertificateViewer", std::move(params2), true); | 1216 SendCommand("Security.showCertificateViewer", std::move(params2), true); |
1212 EXPECT_EQ(transient_entry->GetSSL().certificate, last_shown_certificate()); | 1217 EXPECT_EQ(transient_entry->GetSSL().certificate, last_shown_certificate()); |
1213 } | 1218 } |
1214 | 1219 |
1215 } // namespace content | 1220 } // namespace content |
OLD | NEW |