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

Issue 2691073003: Add javatests for the WebView SafeBrowsing feature (Closed)

Created:
3 years, 10 months ago by Nate Fischer
Modified:
3 years, 10 months ago
CC:
android-webview-reviews_chromium.org, chromium-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add javatests for the WebView SafeBrowsing feature This adds javatests for the SafeBrowsing feature in webview. It tests: * Loading a safe URL does not show an interstitial * Loading a malicious URL does show an interstitial * Loading a page with a malicious subresource does show an interstitial BUG=676737 Review-Url: https://codereview.chromium.org/2691073003 Cr-Commit-Position: refs/heads/master@{#452385} Committed: https://chromium.googlesource.com/chromium/src/+/f7c3ed28c88cf8f5e30a3879c44005d527ea11a6

Patch Set 1 #

Total comments: 11

Patch Set 2 : No sleeps, reduce duplicated code, switch to EmbeddedTestServer, etc. #

Total comments: 10

Patch Set 3 : Refactoring #

Patch Set 4 : Fix DEPS issue #

Patch Set 5 : The callback helper approach didn't work, so just more carefully checks pixel color #

Total comments: 2

Patch Set 6 : No polling, only waitforcallback #

Patch Set 7 : Make the iframe html gray instead of black, change assertFalse(... == ...) to assertTrue(... != ...… #

Patch Set 8 : Changing the pages from using body.background-color to creating a full-size div with the background… #

Total comments: 2

Patch Set 9 : Move getPixelColorAtCenterOfView to GraphicsTestUtils #

Unified diffs Side-by-side diffs Delta from patch set Stats (+308 lines, -6 lines) Patch
M android_webview/javatests/DEPS View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java View 1 2 3 4 5 6 7 8 3 chunks +8 lines, -6 lines 0 comments Download
A android_webview/javatests/src/org/chromium/android_webview/test/SafeBrowsingTest.java View 1 2 3 4 5 6 7 8 1 chunk +220 lines, -0 lines 0 comments Download
M android_webview/javatests/src/org/chromium/android_webview/test/util/GraphicsTestUtils.java View 1 2 3 4 5 6 7 8 2 chunks +14 lines, -0 lines 0 comments Download
M android_webview/test/BUILD.gn View 2 chunks +2 lines, -0 lines 0 comments Download
A android_webview/test/data/green.html View 1 2 3 4 5 6 7 1 chunk +14 lines, -0 lines 0 comments Download
A android_webview/test/data/iframe.html View 1 2 3 4 5 6 7 1 chunk +21 lines, -0 lines 0 comments Download
A android_webview/test/data/malware.html View 1 2 3 4 5 6 7 1 chunk +14 lines, -0 lines 0 comments Download
A android_webview/test/data/safe.html View 1 2 3 4 5 6 7 1 chunk +14 lines, -0 lines 0 comments Download

Messages

Total messages: 53 (38 generated)
Nate Fischer
PTAL. This relies on TestWebServer, which is deprecated in favor of EmbeddedTestServer. If this is ...
3 years, 10 months ago (2017-02-14 02:00:49 UTC) #4
boliu
> This relies on TestWebServer, which is deprecated in favor of > EmbeddedTestServer. If this ...
3 years, 10 months ago (2017-02-14 02:34:32 UTC) #5
Nate Fischer
PTAL. I'm still looking into the trybot failures. https://codereview.chromium.org/2691073003/diff/1/android_webview/javatests/src/org/chromium/android_webview/test/SafeBrowsingTest.java File android_webview/javatests/src/org/chromium/android_webview/test/SafeBrowsingTest.java (right): https://codereview.chromium.org/2691073003/diff/1/android_webview/javatests/src/org/chromium/android_webview/test/SafeBrowsingTest.java#newcode67 android_webview/javatests/src/org/chromium/android_webview/test/SafeBrowsingTest.java:67: return ...
3 years, 10 months ago (2017-02-14 17:17:55 UTC) #12
boliu
https://codereview.chromium.org/2691073003/diff/1/android_webview/javatests/src/org/chromium/android_webview/test/SafeBrowsingTest.java File android_webview/javatests/src/org/chromium/android_webview/test/SafeBrowsingTest.java (right): https://codereview.chromium.org/2691073003/diff/1/android_webview/javatests/src/org/chromium/android_webview/test/SafeBrowsingTest.java#newcode113 android_webview/javatests/src/org/chromium/android_webview/test/SafeBrowsingTest.java:113: return (bitmap.getPixel(0, 0) == INTERSTITIAL_COLOR); On 2017/02/14 17:17:55, Nate ...
3 years, 10 months ago (2017-02-14 18:31:40 UTC) #13
Nate Fischer
Thanks for explanation. As we discussed in person, I think I actually need to check ...
3 years, 10 months ago (2017-02-14 19:42:55 UTC) #14
boliu
https://codereview.chromium.org/2691073003/diff/20001/android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java File android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java (right): https://codereview.chromium.org/2691073003/diff/20001/android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java#newcode97 android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java:97: protected void createAwBrowserContext() { On 2017/02/14 19:42:55, Nate Fischer ...
3 years, 10 months ago (2017-02-14 22:26:57 UTC) #17
Nate Fischer
PTAL. No more polling. The malicious-subresource test is broken now though. The target page is ...
3 years, 10 months ago (2017-02-15 22:53:20 UTC) #28
Nate Fischer
Sorry, the last reply included a draft I forgot to remove https://codereview.chromium.org/2691073003/diff/80001/android_webview/javatests/src/org/chromium/android_webview/test/SafeBrowsingTest.java File android_webview/javatests/src/org/chromium/android_webview/test/SafeBrowsingTest.java (right): ...
3 years, 10 months ago (2017-02-15 23:35:21 UTC) #29
Nate Fischer
+vakh@ for the DEPS change (our safebrowsing tests need to depend on components/safe_browsing_db) boliu@: PTAL. ...
3 years, 10 months ago (2017-02-21 20:06:37 UTC) #39
boliu
https://codereview.chromium.org/2691073003/diff/140001/android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java File android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java (right): https://codereview.chromium.org/2691073003/diff/140001/android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java#newcode375 android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java:375: public int getPixelColorAtCenterOfView( I think this can just be ...
3 years, 10 months ago (2017-02-21 21:37:48 UTC) #40
boliu
On 2017/02/21 21:37:48, boliu wrote: > https://codereview.chromium.org/2691073003/diff/140001/android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java > File > android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java > (right): > > ...
3 years, 10 months ago (2017-02-21 21:44:05 UTC) #41
Nate Fischer
https://codereview.chromium.org/2691073003/diff/140001/android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java File android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java (right): https://codereview.chromium.org/2691073003/diff/140001/android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java#newcode375 android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java:375: public int getPixelColorAtCenterOfView( On 2017/02/21 at 21:37:47, boliu wrote: ...
3 years, 10 months ago (2017-02-21 21:56:07 UTC) #43
vakh (use Gerrit instead)
DEPS lgtm
3 years, 10 months ago (2017-02-22 22:56:27 UTC) #47
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2691073003/160001
3 years, 10 months ago (2017-02-23 00:16:47 UTC) #50
commit-bot: I haz the power
3 years, 10 months ago (2017-02-23 04:05:18 UTC) #53
Message was sent while issue was closed.
Committed patchset #9 (id:160001) as
https://chromium.googlesource.com/chromium/src/+/f7c3ed28c88cf8f5e30a3879c440...

Powered by Google App Engine
This is Rietveld 408576698