OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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; | 5 package org.chromium.chrome.browser; |
6 | 6 |
7 import android.graphics.Bitmap; | 7 import android.graphics.Bitmap; |
8 import android.test.suitebuilder.annotation.MediumTest; | 8 import android.test.suitebuilder.annotation.MediumTest; |
9 import android.test.suitebuilder.annotation.SmallTest; | 9 import android.test.suitebuilder.annotation.SmallTest; |
10 | 10 |
11 import org.chromium.base.ThreadUtils; | 11 import org.chromium.base.ThreadUtils; |
12 import org.chromium.base.test.util.Feature; | 12 import org.chromium.base.test.util.Feature; |
13 import org.chromium.base.test.util.UrlUtils; | 13 import org.chromium.base.test.util.UrlUtils; |
14 import org.chromium.chrome.shell.ChromeShellActivity; | 14 import org.chromium.chrome.shell.ChromeShellActivity; |
15 import org.chromium.chrome.shell.ChromeShellTestBase; | 15 import org.chromium.chrome.shell.ChromeShellTestBase; |
16 import org.chromium.content.browser.NavigationClient; | 16 import org.chromium.content.browser.NavigationClient; |
17 import org.chromium.content.browser.NavigationEntry; | |
18 import org.chromium.content.browser.NavigationHistory; | |
19 import org.chromium.content.browser.test.util.Criteria; | 17 import org.chromium.content.browser.test.util.Criteria; |
20 import org.chromium.content.browser.test.util.CriteriaHelper; | 18 import org.chromium.content.browser.test.util.CriteriaHelper; |
| 19 import org.chromium.content_public.browser.NavigationEntry; |
| 20 import org.chromium.content_public.browser.NavigationHistory; |
21 | 21 |
22 import java.util.concurrent.Callable; | 22 import java.util.concurrent.Callable; |
23 import java.util.concurrent.ExecutionException; | 23 import java.util.concurrent.ExecutionException; |
24 | 24 |
25 /** | 25 /** |
26 * Tests for the navigation popup. | 26 * Tests for the navigation popup. |
27 */ | 27 */ |
28 public class NavigationPopupTest extends ChromeShellTestBase { | 28 public class NavigationPopupTest extends ChromeShellTestBase { |
29 | 29 |
30 private static final int INVALID_NAVIGATION_INDEX = -1; | 30 private static final int INVALID_NAVIGATION_INDEX = -1; |
31 | 31 |
32 private ChromeShellActivity mActivity; | 32 private ChromeShellActivity mActivity; |
33 | 33 |
34 @Override | 34 @Override |
35 public void setUp() throws Exception { | 35 public void setUp() throws Exception { |
36 super.setUp(); | 36 super.setUp(); |
37 | 37 |
38 mActivity = launchChromeShellWithBlankPage(); | 38 mActivity = launchChromeShellWithBlankPage(); |
39 } | 39 } |
40 | 40 |
41 // Exists solely to expose protected methods to this test. | 41 // Exists solely to expose protected methods to this test. |
42 private static class TestNavigationHistory extends NavigationHistory { | 42 private static class TestNavigationHistory extends NavigationHistory { |
43 @Override | 43 @Override |
44 protected void addEntry(NavigationEntry entry) { | 44 public void addEntry(NavigationEntry entry) { |
45 super.addEntry(entry); | 45 super.addEntry(entry); |
46 } | 46 } |
47 } | 47 } |
48 | 48 |
49 // Exists solely to expose protected methods to this test. | 49 // Exists solely to expose protected methods to this test. |
50 private static class TestNavigationEntry extends NavigationEntry { | 50 private static class TestNavigationEntry extends NavigationEntry { |
51 public TestNavigationEntry(int index, String url, String virtualUrl, Str
ing originalUrl, | 51 public TestNavigationEntry(int index, String url, String virtualUrl, Str
ing originalUrl, |
52 String title, Bitmap favicon) { | 52 String title, Bitmap favicon) { |
53 super(index, url, virtualUrl, originalUrl, title, favicon); | 53 super(index, url, virtualUrl, originalUrl, title, favicon); |
54 } | 54 } |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 public void run() { | 141 public void run() { |
142 popup.performItemClick(1); | 142 popup.performItemClick(1); |
143 } | 143 } |
144 }); | 144 }); |
145 | 145 |
146 assertFalse("Popup did not hide as expected.", popup.isShowing()); | 146 assertFalse("Popup did not hide as expected.", popup.isShowing()); |
147 assertEquals("Popup attempted to navigate to the wrong index", 5, client
.mNavigatedIndex); | 147 assertEquals("Popup attempted to navigate to the wrong index", 5, client
.mNavigatedIndex); |
148 } | 148 } |
149 | 149 |
150 } | 150 } |
OLD | NEW |