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

Unified Diff: chrome/android/junit/src/org/chromium/chrome/browser/fullscreen/BrowserStateBrowserControlsVisibilityDelegateTest.java

Issue 2642263005: Fix fullscreen browser overrides when no tab is present. (Closed)
Patch Set: Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/fullscreen/ChromeFullscreenManager.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/junit/src/org/chromium/chrome/browser/fullscreen/BrowserStateBrowserControlsVisibilityDelegateTest.java
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/fullscreen/BrowserStateBrowserControlsVisibilityDelegateTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/fullscreen/BrowserStateBrowserControlsVisibilityDelegateTest.java
index 4cf267c9365b6f60e28de83d1e0fb318433528f7..337e3ab3c423430ca7c64abeeb63f2ca20c3f692 100644
--- a/chrome/android/junit/src/org/chromium/chrome/browser/fullscreen/BrowserStateBrowserControlsVisibilityDelegateTest.java
+++ b/chrome/android/junit/src/org/chromium/chrome/browser/fullscreen/BrowserStateBrowserControlsVisibilityDelegateTest.java
@@ -21,7 +21,6 @@ import org.robolectric.shadows.ShadowLooper;
import org.robolectric.shadows.ShadowSystemClock;
import org.chromium.base.test.util.Feature;
-import org.chromium.chrome.browser.tab.Tab;
import org.chromium.testing.local.LocalRobolectricTestRunner;
/**
@@ -30,7 +29,7 @@ import org.chromium.testing.local.LocalRobolectricTestRunner;
@RunWith(LocalRobolectricTestRunner.class)
@Config(manifest = Config.NONE)
public class BrowserStateBrowserControlsVisibilityDelegateTest {
- @Mock private Tab mTab;
+ @Mock private Runnable mCallback;
private BrowserStateBrowserControlsVisibilityDelegate mDelegate;
@@ -38,8 +37,7 @@ public class BrowserStateBrowserControlsVisibilityDelegateTest {
public void beforeTest() {
MockitoAnnotations.initMocks(this);
- mDelegate = new BrowserStateBrowserControlsVisibilityDelegate();
- mDelegate.setTab(mTab);
+ mDelegate = new BrowserStateBrowserControlsVisibilityDelegate(mCallback);
}
private void advanceTime(long amount) {
@@ -56,7 +54,7 @@ public class BrowserStateBrowserControlsVisibilityDelegateTest {
ShadowLooper.runUiThreadTasksIncludingDelayedTasks();
assertTrue(mDelegate.isHidingBrowserControlsEnabled());
- verify(mTab, times(2)).updateFullscreenEnabledState();
+ verify(mCallback, times(2)).run();
}
@Test
@@ -71,7 +69,7 @@ public class BrowserStateBrowserControlsVisibilityDelegateTest {
mDelegate.hideControlsPersistent(token);
assertTrue(mDelegate.isHidingBrowserControlsEnabled());
- verify(mTab, times(2)).updateFullscreenEnabledState();
+ verify(mCallback, times(2)).run();
}
@Test
@@ -89,7 +87,7 @@ public class BrowserStateBrowserControlsVisibilityDelegateTest {
ShadowLooper.runUiThreadTasksIncludingDelayedTasks();
assertTrue(mDelegate.isHidingBrowserControlsEnabled());
- verify(mTab, times(2)).updateFullscreenEnabledState();
+ verify(mCallback, times(2)).run();
}
@Test
@@ -108,7 +106,7 @@ public class BrowserStateBrowserControlsVisibilityDelegateTest {
mDelegate.hideControlsPersistent(token);
assertTrue(mDelegate.isHidingBrowserControlsEnabled());
- verify(mTab, times(2)).updateFullscreenEnabledState();
+ verify(mCallback, times(2)).run();
}
@Test
@@ -131,7 +129,7 @@ public class BrowserStateBrowserControlsVisibilityDelegateTest {
ShadowLooper.runUiThreadTasksIncludingDelayedTasks();
assertTrue(mDelegate.isHidingBrowserControlsEnabled());
- verify(mTab, times(2)).updateFullscreenEnabledState();
+ verify(mCallback, times(2)).run();
}
@Test
@@ -158,6 +156,6 @@ public class BrowserStateBrowserControlsVisibilityDelegateTest {
mDelegate.hideControlsPersistent(thirdToken);
assertTrue(mDelegate.isHidingBrowserControlsEnabled());
- verify(mTab, times(2)).updateFullscreenEnabledState();
+ verify(mCallback, times(2)).run();
}
}
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/fullscreen/ChromeFullscreenManager.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698