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

Side by Side Diff: content/browser/renderer_host/begin_frame_observer_proxy_unittest.cc

Issue 1408213002: Add hooks for flushing input from BeginFrame dispatch on Aura (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix build for real Created 5 years, 2 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 <algorithm> 5 #include <algorithm>
6 #include <list> 6 #include <list>
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 // SendBeginFrame is not called when compositor is reset. 87 // SendBeginFrame is not called when compositor is reset.
88 begin_frame_observer.ResetCompositor(); 88 begin_frame_observer.ResetCompositor();
89 cc::BeginFrameArgs args3 = 89 cc::BeginFrameArgs args3 =
90 cc::CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, 90 cc::CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE,
91 base::TimeTicks::FromInternalValue(99)); 91 base::TimeTicks::FromInternalValue(99));
92 EXPECT_CALL(client, SendBeginFrame(_)).Times(0); 92 EXPECT_CALL(client, SendBeginFrame(_)).Times(0);
93 compositor()->SendBeginFramesToChildren(args3); 93 compositor()->SendBeginFramesToChildren(args3);
94 Mock::VerifyAndClearExpectations(&client); 94 Mock::VerifyAndClearExpectations(&client);
95 } 95 }
96 96
97 TEST_F(BeginFrameObserverProxyTest, SingleBeginFrameScheduling) {
98 MockBeginFrameObserverProxyClient client;
99 BeginFrameObserverProxy begin_frame_observer(&client);
100 begin_frame_observer.SetCompositor(compositor());
101 begin_frame_observer.SetNeedsOneBeginFrame();
102
103 // SendBeginFrame is called when new |args| is delivered.
104 cc::BeginFrameArgs args = cc::CreateBeginFrameArgsForTesting(
105 BEGINFRAME_FROM_HERE, base::TimeTicks::FromInternalValue(33));
106 EXPECT_CALL(client, SendBeginFrame(args));
107 compositor()->SendBeginFramesToChildren(args);
108 Mock::VerifyAndClearExpectations(&client);
109
110 // SendBeginFrame is not called when new |args2| is delivered, as the
111 // single frame request was already satisified.
112 cc::BeginFrameArgs args2 = cc::CreateBeginFrameArgsForTesting(
113 BEGINFRAME_FROM_HERE, base::TimeTicks::FromInternalValue(66));
114 EXPECT_CALL(client, SendBeginFrame(_)).Times(0);
115 compositor()->SendBeginFramesToChildren(args2);
116 Mock::VerifyAndClearExpectations(&client);
117
118 begin_frame_observer.ResetCompositor();
119 }
120
97 } // namespace content 121 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/begin_frame_observer_proxy.cc ('k') | content/browser/renderer_host/input/input_router.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698