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

Side by Side Diff: Source/wtf/DoubleBufferedDequeTest.cpp

Issue 439923006: Prioritizing input and compositor tasks in the blink scheduler. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Adding wtf/DoubleBufferedDeque.h to git Created 6 years, 4 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "config.h"
6 #include "wtf/DoubleBufferedDeque.h"
7
8 #include <gtest/gtest.h>
9
10 namespace {
11
12 using blink::DoubleBufferedDeque;
13
14 typedef testing::Test DoubleBufferedDequeTest;
15
16 TEST(DoubleBufferedDequeTest, TestDoubleBuffering)
17 {
18 DoubleBufferedDeque<int> queue;
19 queue.append(1);
20 queue.append(10);
21 queue.append(100);
22
23 queue.append(2);
24 EXPECT_EQ(1, queue.swapBuffers().takeFirst());
25 EXPECT_EQ(10, queue.swapBuffers().takeFirst());
26 EXPECT_EQ(100, queue.swapBuffers().takeFirst());
27
28 queue.append(3);
29 EXPECT_EQ(2, queue.swapBuffers().takeFirst());
30
31 queue.append(4);
32 EXPECT_EQ(3, queue.swapBuffers().takeFirst());
33 }
34
35 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698