1 package org.mozilla.gecko.tests;
2 
3 import android.content.Intent;
4 
5 import org.mozilla.gecko.tests.helpers.GeckoHelper;
6 
7 public class AssistIntentTest extends SessionTest {
8     @Override
setActivityIntent(Intent intent)9     public void setActivityIntent(Intent intent) {
10         // We want to make sure that we have opened a new tab, so we're creating a session
11         // where the default selected tab will *not* be about:home.
12         Session session = createTestSession(/*selected tab*/ 1);
13         injectSessionToRestore(intent, session);
14 
15         super.setActivityIntent(intent);
16     }
17 
verifyAssistIntentHandling()18     protected void verifyAssistIntentHandling() {
19         // After an ACTION_ASSIST intent, we should be in editing mode...
20         mToolbar.assertIsEditing();
21 
22         // ... the input field should be empty in readiness for the user to type...
23         mToolbar.assertUrl("");
24 
25         // ... and we should have opened a new tab in addition to those from the "restored" session.
26         mToolbar.dismissEditingMode();
27         mToolbar.assertTitle(mStringHelper.ABOUT_HOME_URL);
28     }
29 }
30