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

Side by Side Diff: chrome/android/javatests/src/org/chromium/chrome/browser/ntp/NewTabPageTest.java

Issue 2885023002: Add NTPCondensedLayout to test config. (Closed)
Patch Set: Disable condensed layout in tests that require a logo. 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 | « no previous file | testing/variations/fieldtrial_testing_config.json » ('j') | 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.ntp; 5 package org.chromium.chrome.browser.ntp;
6 6
7 import android.graphics.Canvas; 7 import android.graphics.Canvas;
8 import android.support.test.InstrumentationRegistry; 8 import android.support.test.InstrumentationRegistry;
9 import android.support.test.filters.LargeTest; 9 import android.support.test.filters.LargeTest;
10 import android.support.test.filters.MediumTest; 10 import android.support.test.filters.MediumTest;
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 webServer.shutdown(); 383 webServer.shutdown();
384 } 384 }
385 } 385 }
386 386
387 /** 387 /**
388 * Tests setting whether the search provider has a logo. 388 * Tests setting whether the search provider has a logo.
389 */ 389 */
390 @Test 390 @Test
391 @SmallTest 391 @SmallTest
392 @Feature({"NewTabPage"}) 392 @Feature({"NewTabPage"})
393 @CommandLineFlags.Add("disable-features=NTPCondensedLayout")
393 public void testSetSearchProviderHasLogo() throws Throwable { 394 public void testSetSearchProviderHasLogo() throws Throwable {
394 mActivityTestRule.runOnUiThread(new Runnable() { 395 mActivityTestRule.runOnUiThread(new Runnable() {
395 @Override 396 @Override
396 public void run() { 397 public void run() {
397 NewTabPageView ntpView = mNtp.getNewTabPageView(); 398 NewTabPageView ntpView = mNtp.getNewTabPageView();
398 View logoView = ntpView.findViewById(R.id.search_provider_logo); 399 View logoView = ntpView.findViewById(R.id.search_provider_logo);
399 Assert.assertEquals(View.VISIBLE, logoView.getVisibility()); 400 Assert.assertEquals(View.VISIBLE, logoView.getVisibility());
400 ntpView.setSearchProviderHasLogo(false); 401 ntpView.setSearchProviderHasLogo(false);
401 Assert.assertEquals(View.GONE, logoView.getVisibility()); 402 Assert.assertEquals(View.GONE, logoView.getVisibility());
402 ntpView.setSearchProviderHasLogo(true); 403 ntpView.setSearchProviderHasLogo(true);
(...skipping 24 matching lines...) Expand all
427 }); 428 });
428 } 429 }
429 430
430 /** 431 /**
431 * Verifies that the placeholder is only shown when there are no tile sugges tions and the search 432 * Verifies that the placeholder is only shown when there are no tile sugges tions and the search
432 * provider has no logo. 433 * provider has no logo.
433 */ 434 */
434 @Test 435 @Test
435 @SmallTest 436 @SmallTest
436 @Feature({"NewTabPage"}) 437 @Feature({"NewTabPage"})
438 @CommandLineFlags.Add("disable-features=NTPCondensedLayout")
437 public void testPlaceholder() { 439 public void testPlaceholder() {
438 final NewTabPageView ntpView = mNtp.getNewTabPageView(); 440 final NewTabPageView ntpView = mNtp.getNewTabPageView();
439 final View logoView = ntpView.findViewById(R.id.search_provider_logo); 441 final View logoView = ntpView.findViewById(R.id.search_provider_logo);
440 final View searchBoxView = ntpView.findViewById(R.id.search_box); 442 final View searchBoxView = ntpView.findViewById(R.id.search_box);
441 443
442 // Initially, the logo is visible, the search box is visible, there is o ne tile suggestion, 444 // Initially, the logo is visible, the search box is visible, there is o ne tile suggestion,
443 // and the placeholder has not been inflated yet. 445 // and the placeholder has not been inflated yet.
444 Assert.assertEquals(View.VISIBLE, logoView.getVisibility()); 446 Assert.assertEquals(View.VISIBLE, logoView.getVisibility());
445 Assert.assertEquals(View.VISIBLE, searchBoxView.getVisibility()); 447 Assert.assertEquals(View.VISIBLE, searchBoxView.getVisibility());
446 Assert.assertEquals(1, mTileGridLayout.getChildCount()); 448 Assert.assertEquals(1, mTileGridLayout.getChildCount());
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 */ 564 */
563 private void waitForFakeboxTopPosition(final NewTabPage ntp, int position) { 565 private void waitForFakeboxTopPosition(final NewTabPage ntp, int position) {
564 CriteriaHelper.pollUiThread(Criteria.equals(position, new Callable<Integ er>() { 566 CriteriaHelper.pollUiThread(Criteria.equals(position, new Callable<Integ er>() {
565 @Override 567 @Override
566 public Integer call() { 568 public Integer call() {
567 return getFakeboxTop(ntp); 569 return getFakeboxTop(ntp);
568 } 570 }
569 })); 571 }));
570 } 572 }
571 } 573 }
OLDNEW
« no previous file with comments | « no previous file | testing/variations/fieldtrial_testing_config.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698