Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreatorTest.cpp

Issue 2039673002: Track performance of toBlob and its complete timeout delay (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "core/html/canvas/CanvasAsyncBlobCreator.h" 5 #include "core/html/canvas/CanvasAsyncBlobCreator.h"
6 6
7 #include "core/html/ImageData.h" 7 #include "core/html/ImageData.h"
8 #include "platform/testing/UnitTestHelpers.h" 8 #include "platform/testing/UnitTestHelpers.h"
9 #include "public/platform/Platform.h" 9 #include "public/platform/Platform.h"
10 #include "testing/gmock/include/gmock/gmock.h" 10 #include "testing/gmock/include/gmock/gmock.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 #include "wtf/Functional.h" 12 #include "wtf/Functional.h"
13 13
14 namespace blink { 14 namespace blink {
15 15
16 typedef CanvasAsyncBlobCreator::IdleTaskStatus IdleTaskStatus; 16 typedef CanvasAsyncBlobCreator::IdleTaskStatus IdleTaskStatus;
17 17
18 class MockCanvasAsyncBlobCreator : public CanvasAsyncBlobCreator { 18 class MockCanvasAsyncBlobCreator : public CanvasAsyncBlobCreator {
19 public: 19 public:
20 MockCanvasAsyncBlobCreator(DOMUint8ClampedArray* data, const IntSize& size, MimeType mimeType) 20 MockCanvasAsyncBlobCreator(DOMUint8ClampedArray* data, const IntSize& size, MimeType mimeType)
21 : CanvasAsyncBlobCreator(data, mimeType, size, nullptr) 21 : CanvasAsyncBlobCreator(data, mimeType, size, nullptr, 0)
22 { 22 {
23 } 23 }
24 24
25 CanvasAsyncBlobCreator::IdleTaskStatus idleTaskStatus() 25 CanvasAsyncBlobCreator::IdleTaskStatus idleTaskStatus()
26 { 26 {
27 return m_idleTaskStatus; 27 return m_idleTaskStatus;
28 } 28 }
29 29
30 MOCK_METHOD0(signalTaskSwitchInStartTimeoutEventForTesting, void()); 30 MOCK_METHOD0(signalTaskSwitchInStartTimeoutEventForTesting, void());
31 MOCK_METHOD0(signalTaskSwitchInCompleteTimeoutEventForTesting, void()); 31 MOCK_METHOD0(signalTaskSwitchInCompleteTimeoutEventForTesting, void());
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 { 289 {
290 this->prepareMockCanvasAsyncBlobCreatorFailJpeg(); 290 this->prepareMockCanvasAsyncBlobCreatorFailJpeg();
291 291
292 this->asyncBlobCreator()->scheduleAsyncBlobCreation(true, 1.0); 292 this->asyncBlobCreator()->scheduleAsyncBlobCreation(true, 1.0);
293 testing::enterRunLoop(); 293 testing::enterRunLoop();
294 294
295 EXPECT_EQ(IdleTaskStatus::IdleTaskFailed, this->asyncBlobCreator()->idleTask Status()); 295 EXPECT_EQ(IdleTaskStatus::IdleTaskFailed, this->asyncBlobCreator()->idleTask Status());
296 } 296 }
297 297
298 } 298 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698