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

Side by Side Diff: content/renderer/gpu/queue_message_swap_promise_unittest.cc

Issue 974483002: [WebView] Remove onFailure from VisualStateCallback. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test fix Created 5 years, 9 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
« no previous file with comments | « content/renderer/gpu/frame_swap_message_queue_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "content/renderer/gpu/queue_message_swap_promise.h" 5 #include "content/renderer/gpu/queue_message_swap_promise.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/memory/scoped_vector.h" 9 #include "base/memory/scoped_vector.h"
10 #include "cc/base/swap_promise.h" 10 #include "cc/base/swap_promise.h"
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 287
288 EXPECT_TRUE(NextSwapMessages().empty()); 288 EXPECT_TRUE(NextSwapMessages().empty());
289 EXPECT_TRUE(frame_swap_message_queue_->Empty()); 289 EXPECT_TRUE(frame_swap_message_queue_->Empty());
290 } 290 }
291 291
292 TEST_F(QueueMessageSwapPromiseTest, VisalStateSwapPromiseDidNotSwapNoUpdate) { 292 TEST_F(QueueMessageSwapPromiseTest, VisalStateSwapPromiseDidNotSwapNoUpdate) {
293 VisualStateSwapPromiseDidNotSwap(cc::SwapPromise::COMMIT_NO_UPDATE); 293 VisualStateSwapPromiseDidNotSwap(cc::SwapPromise::COMMIT_NO_UPDATE);
294 } 294 }
295 295
296 TEST_F(QueueMessageSwapPromiseTest, 296 TEST_F(QueueMessageSwapPromiseTest,
297 VisalStateSwapPromiseDidNotSwapCommitFails) { 297 VisualStateSwapPromiseDidNotSwapCommitFails) {
298 VisualStateSwapPromiseDidNotSwap(cc::SwapPromise::COMMIT_FAILS); 298 // COMMIT_FAILS is treated differently:
299 // If we fail to swap with COMMIT_FAILS, then the renderer is
300 // shutting down, which implies that the RenderFrameHostImpl
301 // destructor will eventually be called, firing the remaining
302 // response callbacks (with swap_success = false) itself.
303 QueueMessageData data[] = {
304 /* { policy, source_frame_number } */
305 {MESSAGE_DELIVERY_POLICY_WITH_VISUAL_STATE, 1},
306 {MESSAGE_DELIVERY_POLICY_WITH_VISUAL_STATE, 1},
307 {MESSAGE_DELIVERY_POLICY_WITH_VISUAL_STATE, 2},
308 };
309 QueueMessages(data, arraysize(data));
310
311 promises_[0]->DidNotSwap(cc::SwapPromise::COMMIT_FAILS);
312 ASSERT_FALSE(promises_[1]);
313 EXPECT_TRUE(NextSwapMessages().empty());
314 EXPECT_EQ(0u, DirectSendMessages().size());
315 EXPECT_FALSE(ContainsMessage(DirectSendMessages(), messages_[0]));
316 EXPECT_FALSE(ContainsMessage(DirectSendMessages(), messages_[1]));
317 EXPECT_FALSE(ContainsMessage(DirectSendMessages(), messages_[2]));
318
319 promises_[2]->DidNotSwap(cc::SwapPromise::COMMIT_FAILS);
320 EXPECT_TRUE(NextSwapMessages().empty());
321 EXPECT_FALSE(ContainsMessage(DirectSendMessages(), messages_[2]));
322
323 EXPECT_TRUE(NextSwapMessages().empty());
324 EXPECT_FALSE(frame_swap_message_queue_->Empty());
299 } 325 }
300 326
301 TEST_F(QueueMessageSwapPromiseTest, VisalStateSwapPromiseDidNotSwapSwapFails) { 327 TEST_F(QueueMessageSwapPromiseTest, VisalStateSwapPromiseDidNotSwapSwapFails) {
302 VisualStateSwapPromiseDidNotSwap(cc::SwapPromise::SWAP_FAILS); 328 VisualStateSwapPromiseDidNotSwap(cc::SwapPromise::SWAP_FAILS);
303 } 329 }
304 330
305 } // namespace content 331 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/gpu/frame_swap_message_queue_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698