OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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.content.BroadcastReceiver; | 7 import android.content.BroadcastReceiver; |
8 import android.content.Context; | 8 import android.content.Context; |
9 import android.content.Intent; | 9 import android.content.Intent; |
10 import android.content.IntentFilter; | 10 import android.content.IntentFilter; |
11 import android.net.Proxy; | 11 import android.net.Proxy; |
12 import android.test.FlakyTest; | 12 import android.test.FlakyTest; |
13 import android.test.mock.MockContext; | 13 import android.test.mock.MockContext; |
14 import android.test.suitebuilder.annotation.SmallTest; | 14 import android.test.suitebuilder.annotation.SmallTest; |
15 | 15 |
16 import org.chromium.android_webview.AwContents; | 16 import org.chromium.android_webview.AwContents; |
17 import org.chromium.base.test.util.DisabledTest; | |
18 import org.chromium.base.test.util.Feature; | 17 import org.chromium.base.test.util.Feature; |
19 import org.chromium.base.test.util.UrlUtils; | 18 import org.chromium.base.test.util.UrlUtils; |
20 import org.chromium.base.ThreadUtils; | 19 import org.chromium.base.ThreadUtils; |
21 import org.chromium.content.browser.ContentViewCore; | 20 import org.chromium.content.browser.ContentViewCore; |
22 import org.chromium.content.browser.ContentViewStatics; | 21 import org.chromium.content.browser.ContentViewStatics; |
23 import org.chromium.net.ProxyChangeListener; | 22 import org.chromium.net.ProxyChangeListener; |
24 | 23 |
25 import java.util.concurrent.atomic.AtomicBoolean; | 24 import java.util.concurrent.atomic.AtomicBoolean; |
26 import java.util.concurrent.atomic.AtomicReference; | 25 import java.util.concurrent.atomic.AtomicReference; |
27 import java.util.concurrent.Callable; | 26 import java.util.concurrent.Callable; |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 ContentViewStatics.disablePlatformNotifications(); | 104 ContentViewStatics.disablePlatformNotifications(); |
106 receiverRef.get().onReceive(context, intent); | 105 receiverRef.get().onReceive(context, intent); |
107 assertEquals(false, proxyChanged.get()); | 106 assertEquals(false, proxyChanged.get()); |
108 | 107 |
109 // Now re-enable notifications to make sure they work again. | 108 // Now re-enable notifications to make sure they work again. |
110 ContentViewStatics.enablePlatformNotifications(); | 109 ContentViewStatics.enablePlatformNotifications(); |
111 receiverRef.get().onReceive(context, intent); | 110 receiverRef.get().onReceive(context, intent); |
112 assertEquals(true, proxyChanged.get()); | 111 assertEquals(true, proxyChanged.get()); |
113 } | 112 } |
114 } | 113 } |
OLD | NEW |