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

Side by Side Diff: chrome/android/javatests/src/org/chromium/chrome/browser/webapps/AddToHomescreenManagerTest.java

Issue 2524153002: Correct EmbeddedTestServer usage in Android tests. (Closed)
Patch Set: Correct EmbeddedTestServer usage in Android tests. Created 4 years 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 | « no previous file | 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 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 package org.chromium.chrome.browser.webapps; 5 package org.chromium.chrome.browser.webapps;
6 6
7 import android.app.Activity; 7 import android.app.Activity;
8 import android.content.Context; 8 import android.content.Context;
9 import android.content.Intent; 9 import android.content.Intent;
10 import android.graphics.Bitmap; 10 import android.graphics.Bitmap;
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 @Override 153 @Override
154 public void startMainActivity() throws InterruptedException { 154 public void startMainActivity() throws InterruptedException {
155 startMainActivityOnBlankPage(); 155 startMainActivityOnBlankPage();
156 } 156 }
157 157
158 @Override 158 @Override
159 public void setUp() throws Exception { 159 public void setUp() throws Exception {
160 super.setUp(); 160 super.setUp();
161 ChromeWebApkHost.initForTesting(false); 161 ChromeWebApkHost.initForTesting(false);
162 mTestServer = EmbeddedTestServer.createAndStartServer(getInstrumentation ().getContext()); 162 mTestServer = EmbeddedTestServer.createAndStartServer(getInstrumentation ().getContext());
163 // Register handler for "slow?10000" URL.
164 mTestServer.addDefaultHandlers(mTestServer.getURL("/chrome/test/data"));
165 mShortcutHelperDelegate = new TestShortcutHelperDelegate(); 163 mShortcutHelperDelegate = new TestShortcutHelperDelegate();
166 ShortcutHelper.setDelegateForTests(mShortcutHelperDelegate); 164 ShortcutHelper.setDelegateForTests(mShortcutHelperDelegate);
167 mActivity = getActivity(); 165 mActivity = getActivity();
168 mTab = mActivity.getActivityTab(); 166 mTab = mActivity.getActivityTab();
169 } 167 }
170 168
171 @SmallTest 169 @SmallTest
172 @Feature("{Webapp}") 170 @Feature("{Webapp}")
173 public void testAddWebappShortcuts() throws Exception { 171 public void testAddWebappShortcuts() throws Exception {
174 // Add a webapp shortcut and make sure the intent's parameters make sens e. 172 // Add a webapp shortcut and make sure the intent's parameters make sens e.
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 public Integer call() { 337 public Integer call() {
340 return getActivity().getTabModelSelector().getModel(false).getCo unt(); 338 return getActivity().getTabModelSelector().getModel(false).getCo unt();
341 } 339 }
342 })); 340 }));
343 341
344 TabModel tabModel = getActivity().getTabModelSelector().getModel(false); 342 TabModel tabModel = getActivity().getTabModelSelector().getModel(false);
345 assertEquals(0, tabModel.indexOf(mTab)); 343 assertEquals(0, tabModel.indexOf(mTab));
346 return getActivity().getTabModelSelector().getModel(false).getTabAt(1); 344 return getActivity().getTabModelSelector().getModel(false).getTabAt(1);
347 } 345 }
348 } 346 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698