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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 explicit MockScreenshotManager(content::NavigationControllerImpl* owner) | 71 explicit MockScreenshotManager(content::NavigationControllerImpl* owner) |
72 : content::NavigationEntryScreenshotManager(owner), | 72 : content::NavigationEntryScreenshotManager(owner), |
73 encoding_screenshot_in_progress_(false) { | 73 encoding_screenshot_in_progress_(false) { |
74 } | 74 } |
75 | 75 |
76 virtual ~MockScreenshotManager() { | 76 virtual ~MockScreenshotManager() { |
77 } | 77 } |
78 | 78 |
79 void TakeScreenshotFor(content::NavigationEntryImpl* entry) { | 79 void TakeScreenshotFor(content::NavigationEntryImpl* entry) { |
80 SkBitmap bitmap; | 80 SkBitmap bitmap; |
81 bitmap.allocN32Pixels(1, 1); | 81 bitmap.allocPixels(SkImageInfo::Make( |
| 82 1, 1, kAlpha_8_SkColorType, kPremul_SkAlphaType)); |
82 bitmap.eraseARGB(0, 0, 0, 0); | 83 bitmap.eraseARGB(0, 0, 0, 0); |
83 encoding_screenshot_in_progress_ = true; | 84 encoding_screenshot_in_progress_ = true; |
84 OnScreenshotTaken(entry->GetUniqueID(), true, bitmap); | 85 OnScreenshotTaken(entry->GetUniqueID(), true, bitmap); |
85 WaitUntilScreenshotIsReady(); | 86 WaitUntilScreenshotIsReady(); |
86 } | 87 } |
87 | 88 |
88 int GetScreenshotCount() { | 89 int GetScreenshotCount() { |
89 return content::NavigationEntryScreenshotManager::GetScreenshotCount(); | 90 return content::NavigationEntryScreenshotManager::GetScreenshotCount(); |
90 } | 91 } |
91 | 92 |
(...skipping 4253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4345 params.post_id = -1; | 4346 params.post_id = -1; |
4346 test_rvh()->SendNavigateWithParams(¶ms); | 4347 test_rvh()->SendNavigateWithParams(¶ms); |
4347 | 4348 |
4348 // Now reload. replaceState overrides the POST, so we should not show a | 4349 // Now reload. replaceState overrides the POST, so we should not show a |
4349 // repost warning dialog. | 4350 // repost warning dialog. |
4350 controller_impl().Reload(true); | 4351 controller_impl().Reload(true); |
4351 EXPECT_EQ(0, delegate->repost_form_warning_count()); | 4352 EXPECT_EQ(0, delegate->repost_form_warning_count()); |
4352 } | 4353 } |
4353 | 4354 |
4354 } // namespace content | 4355 } // namespace content |
OLD | NEW |