| 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.android_webview.test; | 5 package org.chromium.android_webview.test; |
| 6 | 6 |
| 7 import android.os.Handler; | 7 import android.os.Handler; |
| 8 import android.os.Looper; | 8 import android.os.Looper; |
| 9 import android.test.suitebuilder.annotation.SmallTest; | 9 import android.test.suitebuilder.annotation.SmallTest; |
| 10 | 10 |
| 11 import org.chromium.android_webview.AwContents; | 11 import org.chromium.android_webview.AwContents; |
| 12 import org.chromium.android_webview.permission.AwPermissionRequest; | 12 import org.chromium.android_webview.permission.AwPermissionRequest; |
| 13 import org.chromium.android_webview.test.util.CommonResources; | 13 import org.chromium.android_webview.test.util.CommonResources; |
| 14 import org.chromium.base.test.util.Feature; | 14 import org.chromium.base.test.util.Feature; |
| 15 import org.chromium.net.test.util.TestWebServer; | 15 import org.chromium.net.test.util.TestWebServer; |
| 16 | 16 |
| 17 import java.util.concurrent.Callable; | 17 import java.util.concurrent.Callable; |
| 18 | 18 |
| 19 /** | 19 /** |
| 20 * Test AwPermissionManager. | 20 * Test AwPermissionManager. |
| 21 */ | 21 */ |
| 22 public class AwPermissionManagerTest extends AwTestBase { | 22 public class AwPermissionManagerTest extends AwTestBase { |
| 23 | 23 |
| 24 private static final String REQUEST_DUPLICATE = "<html> <script>" | 24 private static final String REQUEST_DUPLICATE = "<html> <script>" |
| 25 + "navigator.requestMIDIAccess().then(function() {" | 25 + "navigator.requestMIDIAccess({sysex: true}).then(function() {" |
| 26 + "});" | 26 + "});" |
| 27 + "navigator.requestMIDIAccess().then(function() {" | 27 + "navigator.requestMIDIAccess({sysex: true}).then(function() {" |
| 28 + " window.document.title = 'second-granted';" | 28 + " window.document.title = 'second-granted';" |
| 29 + "});" | 29 + "});" |
| 30 + "</script><body>" | 30 + "</script><body>" |
| 31 + "</body></html>"; | 31 + "</body></html>"; |
| 32 | 32 |
| 33 private TestWebServer mTestWebServer; | 33 private TestWebServer mTestWebServer; |
| 34 private String mPage; | 34 private String mPage; |
| 35 | 35 |
| 36 @Override | 36 @Override |
| 37 protected void setUp() throws Exception { | 37 protected void setUp() throws Exception { |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 throws Exception { | 86 throws Exception { |
| 87 pollInstrumentationThread(new Callable<Boolean>() { | 87 pollInstrumentationThread(new Callable<Boolean>() { |
| 88 @Override | 88 @Override |
| 89 public Boolean call() throws Exception { | 89 public Boolean call() throws Exception { |
| 90 return title.equals(getTitleOnUiThread(awContents)); | 90 return title.equals(getTitleOnUiThread(awContents)); |
| 91 } | 91 } |
| 92 }); | 92 }); |
| 93 } | 93 } |
| 94 } | 94 } |
| 95 | 95 |
| OLD | NEW |