| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "base/file_util.h" | 5 #include "base/file_util.h" |
| 6 #include "base/gfx/jpeg_codec.h" | 6 #include "base/gfx/jpeg_codec.h" |
| 7 #include "base/shared_memory.h" | 7 #include "base/shared_memory.h" |
| 8 #include "chrome/common/native_web_keyboard_event.h" | 8 #include "chrome/common/native_web_keyboard_event.h" |
| 9 #include "chrome/common/render_messages.h" | 9 #include "chrome/common/render_messages.h" |
| 10 #include "chrome/renderer/print_web_view_helper.h" | 10 #include "chrome/renderer/print_web_view_helper.h" |
| (...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 856 } | 856 } |
| 857 #endif | 857 #endif |
| 858 | 858 |
| 859 TEST_F(RenderViewTest, DidFailProvisionalLoadWithErrorForCancellation) { | 859 TEST_F(RenderViewTest, DidFailProvisionalLoadWithErrorForCancellation) { |
| 860 GetMainFrame()->enableViewSourceMode(true); | 860 GetMainFrame()->enableViewSourceMode(true); |
| 861 WebURLError error; | 861 WebURLError error; |
| 862 error.domain.fromUTF8("test_domain"); | 862 error.domain.fromUTF8("test_domain"); |
| 863 error.reason = net::ERR_ABORTED; | 863 error.reason = net::ERR_ABORTED; |
| 864 error.unreachableURL = GURL("http://foo"); | 864 error.unreachableURL = GURL("http://foo"); |
| 865 WebFrame* web_frame = GetMainFrame(); | 865 WebFrame* web_frame = GetMainFrame(); |
| 866 WebView* web_view = web_frame->view(); | |
| 867 // A cancellation occurred. | 866 // A cancellation occurred. |
| 868 view_->DidFailProvisionalLoadWithError(web_view, error, web_frame); | 867 view_->didFailProvisionalLoad(web_frame, error); |
| 869 // Frame should stay in view-source mode. | 868 // Frame should stay in view-source mode. |
| 870 EXPECT_TRUE(web_frame->isViewSourceModeEnabled()); | 869 EXPECT_TRUE(web_frame->isViewSourceModeEnabled()); |
| 871 } | 870 } |
| 872 | 871 |
| 873 // Print page as bitmap test. | 872 // Print page as bitmap test. |
| 874 TEST_F(RenderViewTest, OnPrintPageAsBitmap) { | 873 TEST_F(RenderViewTest, OnPrintPageAsBitmap) { |
| 875 #if defined(OS_WIN) | 874 #if defined(OS_WIN) |
| 876 // Lets simulate a print pages with Hello world. | 875 // Lets simulate a print pages with Hello world. |
| 877 LoadHTML("<body><p>Hello world!</p></body>"); | 876 LoadHTML("<body><p>Hello world!</p></body>"); |
| 878 | 877 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 904 is_white = false; | 903 is_white = false; |
| 905 break; | 904 break; |
| 906 } | 905 } |
| 907 } | 906 } |
| 908 } | 907 } |
| 909 ASSERT_TRUE(!is_white); | 908 ASSERT_TRUE(!is_white); |
| 910 #else | 909 #else |
| 911 NOTIMPLEMENTED(); | 910 NOTIMPLEMENTED(); |
| 912 #endif | 911 #endif |
| 913 } | 912 } |
| OLD | NEW |