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.Context; | 7 import android.content.Context; |
8 import android.os.Build; | 8 import android.os.Build; |
9 import android.test.suitebuilder.annotation.SmallTest; | 9 import android.test.suitebuilder.annotation.SmallTest; |
10 | 10 |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 | 372 |
373 @Override | 373 @Override |
374 protected void doEnsureSettingHasValue(String value) throws Throwable { | 374 protected void doEnsureSettingHasValue(String value) throws Throwable { |
375 loadDataSync(getData()); | 375 loadDataSync(getData()); |
376 assertEquals( | 376 assertEquals( |
377 value == DEFAULT_UA ? mDefaultUa : value, | 377 value == DEFAULT_UA ? mDefaultUa : value, |
378 getTitleOnUiThread()); | 378 getTitleOnUiThread()); |
379 } | 379 } |
380 | 380 |
381 private String getData() { | 381 private String getData() { |
382 return "<html>" + | 382 return "<html><body onload='document.title=navigator.userAgent'></bo
dy></html>"; |
383 "<body onload='document.writeln(document.title=navigator.use
rAgent)'></body>" + | |
384 "</html>"; | |
385 } | 383 } |
386 } | 384 } |
387 | 385 |
388 class AwSettingsDomStorageEnabledTestHelper extends AwSettingsTestHelper<Boo
lean> { | 386 class AwSettingsDomStorageEnabledTestHelper extends AwSettingsTestHelper<Boo
lean> { |
389 private static final String NO_LOCAL_STORAGE = "No localStorage"; | 387 private static final String NO_LOCAL_STORAGE = "No localStorage"; |
390 private static final String HAS_LOCAL_STORAGE = "Has localStorage"; | 388 private static final String HAS_LOCAL_STORAGE = "Has localStorage"; |
391 | 389 |
392 AwSettingsDomStorageEnabledTestHelper( | 390 AwSettingsDomStorageEnabledTestHelper( |
393 ContentViewCore contentViewCore, | 391 ContentViewCore contentViewCore, |
394 TestAwContentsClient contentViewClient) throws Throwable { | 392 TestAwContentsClient contentViewClient) throws Throwable { |
(...skipping 933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1328 | 1326 |
1329 private void resetResourceRequestCountInContentProvider(String resource) { | 1327 private void resetResourceRequestCountInContentProvider(String resource) { |
1330 Context context = getInstrumentation().getTargetContext(); | 1328 Context context = getInstrumentation().getTargetContext(); |
1331 TestContentProvider.resetResourceRequestCount(context, resource); | 1329 TestContentProvider.resetResourceRequestCount(context, resource); |
1332 } | 1330 } |
1333 | 1331 |
1334 private String createContentUrl(final String target) { | 1332 private String createContentUrl(final String target) { |
1335 return TestContentProvider.createContentUrl(target); | 1333 return TestContentProvider.createContentUrl(target); |
1336 } | 1334 } |
1337 } | 1335 } |
OLD | NEW |