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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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.setConfig(SkBitmap::kARGB_8888_Config, 1, 1); | 81 bitmap.setConfig(SkBitmap::kARGB_8888_Config, 1, 1); |
82 bitmap.allocPixels(); | 82 bitmap.allocPixels(); |
83 bitmap.eraseRGB(0, 0, 0); | 83 bitmap.eraseRGB(0, 0, 0); |
84 encoding_screenshot_in_progress_ = true; | 84 encoding_screenshot_in_progress_ = true; |
85 OnScreenshotTaken(entry->GetUniqueID(), true, bitmap); | 85 OnScreenshotTaken(entry->GetUniqueID(), NULL, true, bitmap); |
86 WaitUntilScreenshotIsReady(); | 86 WaitUntilScreenshotIsReady(); |
87 } | 87 } |
88 | 88 |
89 int GetScreenshotCount() { | 89 int GetScreenshotCount() { |
90 return content::NavigationEntryScreenshotManager::GetScreenshotCount(); | 90 return content::NavigationEntryScreenshotManager::GetScreenshotCount(); |
91 } | 91 } |
92 | 92 |
93 void WaitUntilScreenshotIsReady() { | 93 void WaitUntilScreenshotIsReady() { |
94 if (!encoding_screenshot_in_progress_) | 94 if (!encoding_screenshot_in_progress_) |
95 return; | 95 return; |
(...skipping 3921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4017 EXPECT_EQ(1, controller.GetEntryCount()); | 4017 EXPECT_EQ(1, controller.GetEntryCount()); |
4018 EXPECT_EQ(0, controller.GetCurrentEntryIndex()); | 4018 EXPECT_EQ(0, controller.GetCurrentEntryIndex()); |
4019 EXPECT_EQ(0, controller.GetLastCommittedEntryIndex()); | 4019 EXPECT_EQ(0, controller.GetLastCommittedEntryIndex()); |
4020 EXPECT_EQ(-1, controller.GetPendingEntryIndex()); | 4020 EXPECT_EQ(-1, controller.GetPendingEntryIndex()); |
4021 EXPECT_FALSE(controller.CanGoBack()); | 4021 EXPECT_FALSE(controller.CanGoBack()); |
4022 EXPECT_FALSE(controller.CanGoForward()); | 4022 EXPECT_FALSE(controller.CanGoForward()); |
4023 EXPECT_EQ(url4, controller.GetVisibleEntry()->GetURL()); | 4023 EXPECT_EQ(url4, controller.GetVisibleEntry()->GetURL()); |
4024 } | 4024 } |
4025 | 4025 |
4026 } // namespace content | 4026 } // namespace content |
OLD | NEW |