OLD | NEW |
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.customtabs; | 5 package org.chromium.chrome.browser.customtabs; |
6 | 6 |
7 import android.app.Application; | 7 import android.app.Application; |
8 import android.app.Instrumentation; | 8 import android.app.Instrumentation; |
9 import android.app.PendingIntent; | 9 import android.app.PendingIntent; |
10 import android.content.BroadcastReceiver; | 10 import android.content.BroadcastReceiver; |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 assertTrue("A custom tab toolbar is never shown", toolbarView instanceof
CustomTabToolbar); | 373 assertTrue("A custom tab toolbar is never shown", toolbarView instanceof
CustomTabToolbar); |
374 CustomTabToolbar toolbar = (CustomTabToolbar) toolbarView; | 374 CustomTabToolbar toolbar = (CustomTabToolbar) toolbarView; |
375 final ImageButton actionButton = toolbar.getCustomActionButtonForTest(); | 375 final ImageButton actionButton = toolbar.getCustomActionButtonForTest(); |
376 | 376 |
377 assertNotNull(actionButton); | 377 assertNotNull(actionButton); |
378 assertTrue("Action button should not be shown", | 378 assertTrue("Action button should not be shown", |
379 View.VISIBLE != actionButton.getVisibility()); | 379 View.VISIBLE != actionButton.getVisibility()); |
380 | 380 |
381 CustomTabIntentDataProvider dataProvider = mActivity.getIntentDataProvid
er(); | 381 CustomTabIntentDataProvider dataProvider = mActivity.getIntentDataProvid
er(); |
382 assertNull(dataProvider.getActionButtonIcon()); | 382 assertNull(dataProvider.getActionButtonIcon()); |
383 assertNull(dataProvider.getActionButtonPendingIntentForTest()); | 383 assertNull(dataProvider.getActionButtonPendingIntent()); |
384 } | 384 } |
385 | 385 |
386 @SmallTest | 386 @SmallTest |
387 public void testLaunchWithSession() throws InterruptedException { | 387 public void testLaunchWithSession() throws InterruptedException { |
388 IBinder session = warmUpAndLaunchUrlWithSession(); | 388 IBinder session = warmUpAndLaunchUrlWithSession(); |
389 assertEquals(mActivity.getIntentDataProvider().getSession(), session); | 389 assertEquals(mActivity.getIntentDataProvider().getSession(), session); |
390 } | 390 } |
391 | 391 |
392 @SmallTest | 392 @SmallTest |
393 public void testLoadNewUrlWithSession() throws InterruptedException { | 393 public void testLoadNewUrlWithSession() throws InterruptedException { |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 @Override | 542 @Override |
543 public void onSendFinished(PendingIntent pendingIntent, Intent intent, i
nt resultCode, | 543 public void onSendFinished(PendingIntent pendingIntent, Intent intent, i
nt resultCode, |
544 String resultData, Bundle resultExtras) { | 544 String resultData, Bundle resultExtras) { |
545 if (pendingIntent.equals(mPi)) { | 545 if (pendingIntent.equals(mPi)) { |
546 mUri = intent.getDataString(); | 546 mUri = intent.getDataString(); |
547 mIsSent.set(true); | 547 mIsSent.set(true); |
548 } | 548 } |
549 } | 549 } |
550 } | 550 } |
551 } | 551 } |
OLD | NEW |