| 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/files/file_util.h" | 7 #include "base/files/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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 | 76 |
| 77 virtual ~MockScreenshotManager() { | 77 virtual ~MockScreenshotManager() { |
| 78 } | 78 } |
| 79 | 79 |
| 80 void TakeScreenshotFor(content::NavigationEntryImpl* entry) { | 80 void TakeScreenshotFor(content::NavigationEntryImpl* entry) { |
| 81 SkBitmap bitmap; | 81 SkBitmap bitmap; |
| 82 bitmap.allocPixels(SkImageInfo::Make( | 82 bitmap.allocPixels(SkImageInfo::Make( |
| 83 1, 1, kAlpha_8_SkColorType, kPremul_SkAlphaType)); | 83 1, 1, kAlpha_8_SkColorType, kPremul_SkAlphaType)); |
| 84 bitmap.eraseARGB(0, 0, 0, 0); | 84 bitmap.eraseARGB(0, 0, 0, 0); |
| 85 encoding_screenshot_in_progress_ = true; | 85 encoding_screenshot_in_progress_ = true; |
| 86 OnScreenshotTaken(entry->GetUniqueID(), true, bitmap); | 86 OnScreenshotTaken( |
| 87 entry->GetUniqueID(), true, bitmap, content::READBACK_SUCCESS); |
| 87 WaitUntilScreenshotIsReady(); | 88 WaitUntilScreenshotIsReady(); |
| 88 } | 89 } |
| 89 | 90 |
| 90 int GetScreenshotCount() { | 91 int GetScreenshotCount() { |
| 91 return content::NavigationEntryScreenshotManager::GetScreenshotCount(); | 92 return content::NavigationEntryScreenshotManager::GetScreenshotCount(); |
| 92 } | 93 } |
| 93 | 94 |
| 94 void WaitUntilScreenshotIsReady() { | 95 void WaitUntilScreenshotIsReady() { |
| 95 if (!encoding_screenshot_in_progress_) | 96 if (!encoding_screenshot_in_progress_) |
| 96 return; | 97 return; |
| (...skipping 4263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4360 params.post_id = -1; | 4361 params.post_id = -1; |
| 4361 test_rvh()->SendNavigateWithParams(¶ms); | 4362 test_rvh()->SendNavigateWithParams(¶ms); |
| 4362 | 4363 |
| 4363 // Now reload. replaceState overrides the POST, so we should not show a | 4364 // Now reload. replaceState overrides the POST, so we should not show a |
| 4364 // repost warning dialog. | 4365 // repost warning dialog. |
| 4365 controller_impl().Reload(true); | 4366 controller_impl().Reload(true); |
| 4366 EXPECT_EQ(0, delegate->repost_form_warning_count()); | 4367 EXPECT_EQ(0, delegate->repost_form_warning_count()); |
| 4367 } | 4368 } |
| 4368 | 4369 |
| 4369 } // namespace content | 4370 } // namespace content |
| OLD | NEW |