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

Side by Side Diff: chrome/android/junit/src/org/chromium/chrome/browser/compositor/CompositorSurfaceManagerTest.java

Issue 2893833005: Re-hook up surfaceRedrawNeededAsync callback. (Closed)
Patch Set: Add another interface to fix unit test compile Created 3 years, 7 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 | « chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorView.java ('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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 package org.chromium.chrome.browser.compositor; 5 package org.chromium.chrome.browser.compositor;
6 6
7 import android.app.Activity; 7 import android.app.Activity;
8 import android.graphics.PixelFormat; 8 import android.graphics.PixelFormat;
9 import android.view.Surface; 9 import android.view.Surface;
10 import android.view.SurfaceHolder; 10 import android.view.SurfaceHolder;
(...skipping 29 matching lines...) Expand all
40 40
41 import java.util.Set; 41 import java.util.Set;
42 42
43 /** 43 /**
44 * Unit tests for the CompositorSurfaceManager. 44 * Unit tests for the CompositorSurfaceManager.
45 */ 45 */
46 @RunWith(LocalRobolectricTestRunner.class) 46 @RunWith(LocalRobolectricTestRunner.class)
47 @Config(manifest = Config.NONE) 47 @Config(manifest = Config.NONE)
48 public class CompositorSurfaceManagerTest { 48 public class CompositorSurfaceManagerTest {
49 @Mock 49 @Mock
50 private SurfaceHolder.Callback mCallback; 50 private CompositorSurfaceManager.SurfaceHolderCallbackTarget mCallback;
51 51
52 private CompositorSurfaceManager mManager; 52 private CompositorSurfaceManager mManager;
53 53
54 private FrameLayout mLayout; 54 private FrameLayout mLayout;
55 55
56 /** 56 /**
57 * Implementation of a SurfaceView shadow that provides additional functiona lity for controlling 57 * Implementation of a SurfaceView shadow that provides additional functiona lity for controlling
58 * the state of the underlying (fake) Surface. 58 * the state of the underlying (fake) Surface.
59 */ 59 */
60 @Implements(SurfaceView.class) 60 @Implements(SurfaceView.class)
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 431
432 // When the opaque surface becomes available, we'll get the synthetic de stroy for the 432 // When the opaque surface becomes available, we'll get the synthetic de stroy for the
433 // translucent one that we lost ownership of, and the real create for th e opaque one. 433 // translucent one that we lost ownership of, and the real create for th e opaque one.
434 callbackFor(opaque).surfaceCreated(opaque.getHolder()); 434 callbackFor(opaque).surfaceCreated(opaque.getHolder());
435 assertEquals(2, mLayout.getChildCount()); 435 assertEquals(2, mLayout.getChildCount());
436 verify(mCallback, times(2)).surfaceCreated(opaque.getHolder()); 436 verify(mCallback, times(2)).surfaceCreated(opaque.getHolder());
437 verify(mCallback, times(1)).surfaceDestroyed(opaque.getHolder()); 437 verify(mCallback, times(1)).surfaceDestroyed(opaque.getHolder());
438 verify(mCallback, times(1)).surfaceDestroyed(translucent.getHolder()); 438 verify(mCallback, times(1)).surfaceDestroyed(translucent.getHolder());
439 } 439 }
440 } 440 }
OLDNEW
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorView.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698