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

Side by Side Diff: chrome/android/javatests/src/org/chromium/chrome/browser/test/ModalDialogTest.java

Issue 738693002: Opening new "about:blank" tab if all tabs are closed in tab switcher mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 | chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellActivity.java » ('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 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.test; 5 package org.chromium.chrome.browser.test;
6 6
7 import android.app.AlertDialog; 7 import android.app.AlertDialog;
8 import android.content.DialogInterface; 8 import android.content.DialogInterface;
9 import android.test.suitebuilder.annotation.MediumTest; 9 import android.test.suitebuilder.annotation.MediumTest;
10 import android.util.Log; 10 import android.util.Log;
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 * is closed. 276 * is closed.
277 */ 277 */
278 @MediumTest 278 @MediumTest
279 @Feature({"Browser", "Main"}) 279 @Feature({"Browser", "Main"})
280 public void testDialogDismissedAfterClosingTab() throws InterruptedException { 280 public void testDialogDismissedAfterClosingTab() throws InterruptedException {
281 executeJavaScriptAndWaitForDialog("alert('Android')"); 281 executeJavaScriptAndWaitForDialog("alert('Android')");
282 282
283 ThreadUtils.runOnUiThreadBlocking(new Runnable() { 283 ThreadUtils.runOnUiThreadBlocking(new Runnable() {
284 @Override 284 @Override
285 public void run() { 285 public void run() {
286 getActivity().closeAllTabs(); 286 getActivity().closeTab();
287 } 287 }
288 }); 288 });
289 289
290 // Closing the tab should have dismissed the dialog. 290 // Closing the tab should have dismissed the dialog.
291 boolean criteriaSatisfied = CriteriaHelper.pollForCriteria( 291 boolean criteriaSatisfied = CriteriaHelper.pollForCriteria(
292 new JavascriptAppModalDialogShownCriteria(false)); 292 new JavascriptAppModalDialogShownCriteria(false));
293 assertTrue("The dialog should have been dismissed when its tab was close d.", 293 assertTrue("The dialog should have been dismissed when its tab was close d.",
294 criteriaSatisfied); 294 criteriaSatisfied);
295 } 295 }
296 296
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 button.getVisibility()); 408 button.getVisibility());
409 assertEquals("'" + readableName + "' button has wrong text", 409 assertEquals("'" + readableName + "' button has wrong text",
410 getActivity().getResources().getString(expectedTextResourceId), 410 getActivity().getResources().getString(expectedTextResourceId),
411 button.getText().toString()); 411 button.getText().toString());
412 } 412 }
413 413
414 private TestCallbackHelperContainer getActiveTabTestCallbackHelperContainer( ) { 414 private TestCallbackHelperContainer getActiveTabTestCallbackHelperContainer( ) {
415 return new TestCallbackHelperContainer(getActivity().getActiveTab().getC ontentViewCore()); 415 return new TestCallbackHelperContainer(getActivity().getActiveTab().getC ontentViewCore());
416 } 416 }
417 } 417 }
OLDNEW
« no previous file with comments | « no previous file | chrome/android/shell/java/src/org/chromium/chrome/shell/ChromeShellActivity.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698