Closed Bug 1660241 Opened 2 months ago Closed 23 days ago

Add GeckoRuntimeSetting for safebrowsing provider

Categories

(GeckoView :: General, enhancement, P1)

Unspecified
All
enhancement

Tracking

(firefox83 fixed)

RESOLVED FIXED
83 Branch
Tracking Status
firefox83 --- fixed

People

(Reporter: snorp, Assigned: agi)

Details

(Whiteboard: [geckoview:m82][geckoview:m83])

Attachments

(2 files, 1 obsolete file)

We need this to allow Fenix China to use Baidu instead of Google for their safebrowsing provider. According to Dimi, we can do:

Let’s say you have a new provider “testprovider” and it supports phishing list “testprovider-phsihing-digest256” with SafeBrowsing version 2 protocol.

What you have to do is adding new preference accordingly, for example,

pref("browser.safebrowsing.provider.testprovider.pver", "2.2");
pref(“browser.safebrowsing.provider.testprovider.lists”, “ testprovider-phish-digest256”)
pref(“browser.safebrowsing.provider.testprovider.updateURL”, url to download the list);
pref(”browser.safebrowsing.provider.testprovider.gethashURL”, url to fetch full hash);

then add “testprovider-phsihing-digest256” to existing phishing table

pref("urlclassifier.phishTable", "goog-phish-proto,moztest-phish-simple, testprovider-phsihing-digest256");

We can probably add a runtime setting that manipulates these prefs.

Priority: -- → P1
Whiteboard: [geckoview:m82]

Hi James, is there any update about this bug? Or if there is a general schedule, please let me know. Thanks!

Flags: needinfo?(snorp)
Assignee: nobody → agi
Flags: needinfo?(snorp)
Whiteboard: [geckoview:m82] → [geckoview:m82][geckoview:m83]

rxu: do you people need to override mozilla's tracking protection server too? or is it just Google's?

Flags: needinfo?(rxu)

(In reply to Agi Sferro | :agi | ⏰ PST | he/him from comment #2)

rxu: do you people need to override mozilla's tracking protection server too? or is it just Google's?

Actually we don't want to replace any of these servers, we want to keep these original servers and add other servers.

Flags: needinfo?(rxu)
Pushed by asferro@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/860002a7a547
Add GeckoRuntimeSetting for SafeBrowsing provider. r=droeh,dimi,snorp

Backed out changeset 860002a7a547 (bug 1660241) for ContentBlockingControllerTest.safeBrowsingSettings failures.

Push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&group_state=expanded&searchStr=android%2C7.0%2Cx86-64%2Copt%2Ctest-android-em-7.0-x86_64%2Fopt-geckoview-junit-e10s%2Cgv-junit&fromchange=77d293ef957141dae07713377953129172b1b872&tochange=d17bef3cbc6efe85d3dcd8428c1c70ab7ecce437&selectedTaskRun=MrKNs2AuRWak9O67ZjZZfg.0

Backout link: https://hg.mozilla.org/integration/autoland/rev/d17bef3cbc6efe85d3dcd8428c1c70ab7ecce437

Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=316931991&repo=autoland&lineNumber=2472

[task 2020-09-28T17:11:31.679Z] 17:11:31     INFO -  TEST-START | org.mozilla.geckoview.test.ContentBlockingControllerTest.safeBrowsingSettings
[task 2020-09-28T17:11:31.779Z] 17:11:31     INFO -  org.mozilla.geckoview.test | INSTRUMENTATION_STATUS: numtests=750
[task 2020-09-28T17:11:31.779Z] 17:11:31     INFO -  org.mozilla.geckoview.test | INSTRUMENTATION_STATUS: stream=
[task 2020-09-28T17:11:31.779Z] 17:11:31     INFO -  org.mozilla.geckoview.test | Error in safeBrowsingSettings(org.mozilla.geckoview.test.ContentBlockingControllerTest):
[task 2020-09-28T17:11:31.779Z] 17:11:31     INFO -  org.mozilla.geckoview.test | java.lang.AssertionError: Pref value is set correctly
[task 2020-09-28T17:11:31.779Z] 17:11:31     INFO -  org.mozilla.geckoview.test | Expected: "http://test-get-hash-url.com"
[task 2020-09-28T17:11:31.780Z] 17:11:31     INFO -  org.mozilla.geckoview.test |      but: was "http://10.0.2.2:8888/safebrowsing4-dummy/gethash"
[task 2020-09-28T17:11:31.780Z] 17:11:31     INFO -  org.mozilla.geckoview.test | 	at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
[task 2020-09-28T17:11:31.780Z] 17:11:31     INFO -  org.mozilla.geckoview.test | 	at org.junit.Assert.assertThat(Assert.java:956)
[task 2020-09-28T17:11:31.780Z] 17:11:31     INFO -  org.mozilla.geckoview.test | 	at org.junit.rules.ErrorCollector$1.call(ErrorCollector.java:65)
[task 2020-09-28T17:11:31.780Z] 17:11:31     INFO -  org.mozilla.geckoview.test | 	at org.junit.rules.ErrorCollector.checkSucceeds(ErrorCollector.java:78)
[task 2020-09-28T17:11:31.780Z] 17:11:31     INFO -  org.mozilla.geckoview.test | 	at org.junit.rules.ErrorCollector.checkThat(ErrorCollector.java:63)
[task 2020-09-28T17:11:31.781Z] 17:11:31     INFO -  org.mozilla.geckoview.test | 	at org.mozilla.geckoview.test.rule.GeckoSessionTestRule.checkThat(GeckoSessionTestRule.java:826)
[task 2020-09-28T17:11:31.781Z] 17:11:31     INFO -  org.mozilla.geckoview.test | 	at org.mozilla.geckoview.test.BaseSessionTest.assertThat(BaseSessionTest.kt:89)
[task 2020-09-28T17:11:31.781Z] 17:11:31     INFO -  org.mozilla.geckoview.test | 	at org.mozilla.geckoview.test.ContentBlockingControllerTest.safeBrowsingSettings(ContentBlockingControllerTest.kt:203)
[task 2020-09-28T17:11:31.781Z] 17:11:31     INFO -  org.mozilla.geckoview.test | 	at java.lang.reflect.Method.invoke(Native Method)
[task 2020-09-28T17:11:31.781Z] 17:11:31     INFO -  org.mozilla.geckoview.test | 	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
[task 2020-09-28T17:11:31.782Z] 17:11:31     INFO -  org.mozilla.geckoview.test | 	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
[task 2020-09-28T17:11:31.782Z] 17:11:31     INFO -  org.mozilla.geckoview.test | 	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
[task 2020-09-28T17:11:31.782Z] 17:11:31     INFO -  org.mozilla.geckoview.test | 	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
[task 2020-09-28T17:11:31.782Z] 17:11:31     INFO -  org.mozilla.geckoview.test | 	at org.mozilla.geckoview.test.rule.GeckoSessionTestRule$2.lambda$evaluate$0$GeckoSessionTestRule$2(GeckoSessionTestRule.java:1313)
[task 2020-09-28T17:11:31.782Z] 17:11:31     INFO -  org.mozilla.geckoview.test | 	at org.mozilla.geckoview.test.rule.-$$Lambda$GeckoSessionTestRule$2$sIbRNaZJgAu-QrUVWSGD8JbPSWM.run(lambda)
[task 2020-09-28T17:11:31.783Z] 17:11:31     INFO -  org.mozilla.geckoview.test | 	at android.app.Instrumentation$SyncRunnable.run(Instrumentation.java:1950)
[task 2020-09-28T17:11:31.783Z] 17:11:31     INFO -  org.mozilla.geckoview.test | 	at android.os.Handler.handleCallback(Handler.java:751)
[task 2020-09-28T17:11:31.783Z] 17:11:31     INFO -  org.mozilla.geckoview.test | 	at android.os.Handler.dispatchMessage(Handler.java:95)
[task 2020-09-28T17:11:31.783Z] 17:11:31     INFO -  org.mozilla.geckoview.test | 	at android.os.Looper.loop(Looper.java:154)
[task 2020-09-28T17:11:31.783Z] 17:11:31     INFO -  org.mozilla.geckoview.test | 	at android.app.ActivityThread.main(ActivityThread.java:6077)
[task 2020-09-28T17:11:31.783Z] 17:11:31     INFO -  org.mozilla.geckoview.test | 	at java.lang.reflect.Method.invoke(Native Method)
[task 2020-09-28T17:11:31.783Z] 17:11:31     INFO -  org.mozilla.geckoview.test | 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
[task 2020-09-28T17:11:31.784Z] 17:11:31     INFO -  org.mozilla.geckoview.test | 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
[task 2020-09-28T17:11:31.784Z] 17:11:31     INFO -  org.mozilla.geckoview.test |
[task 2020-09-28T17:11:31.784Z] 17:11:31     INFO -  org.mozilla.geckoview.test | INSTRUMENTATION_STATUS: id=AndroidJUnitRunner
[task 2020-09-28T17:11:31.784Z] 17:11:31     INFO -  org.mozilla.geckoview.test | INSTRUMENTATION_STATUS: test=safeBrowsingSettings
[task 2020-09-28T17:11:31.784Z] 17:11:31     INFO -  org.mozilla.geckoview.test | INSTRUMENTATION_STATUS: class=org.mozilla.geckoview.test.ContentBlockingControllerTest
[task 2020-09-28T17:11:31.784Z] 17:11:31     INFO -  org.mozilla.geckoview.test | INSTRUMENTATION_STATUS: stack=java.lang.AssertionError: Pref value is set correctly
[task 2020-09-28T17:11:31.784Z] 17:11:31     INFO -  org.mozilla.geckoview.test | Expected: "http://test-get-hash-url.com"
[task 2020-09-28T17:11:31.785Z] 17:11:31     INFO -  org.mozilla.geckoview.test |      but: was "http://10.0.2.2:8888/safebrowsing4-dummy/gethash"
[task 2020-09-28T17:11:31.785Z] 17:11:31     INFO -  org.mozilla.geckoview.test | 	at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
[task 2020-09-28T17:11:31.785Z] 17:11:31     INFO -  org.mozilla.geckoview.test | 	at org.junit.Assert.assertThat(Assert.java:956)
[task 2020-09-28T17:11:31.785Z] 17:11:31     INFO -  org.mozilla.geckoview.test | 	at org.junit.rules.ErrorCollector$1.call(ErrorCollector.java:65)
[task 2020-09-28T17:11:31.785Z] 17:11:31     INFO -  org.mozilla.geckoview.test | 	at org.junit.rules.ErrorCollector.checkSucceeds(ErrorCollector.java:78)
[task 2020-09-28T17:11:31.785Z] 17:11:31     INFO -  org.mozilla.geckoview.test | 	at org.junit.rules.ErrorCollector.checkThat(ErrorCollector.java:63)
[task 2020-09-28T17:11:31.786Z] 17:11:31     INFO -  org.mozilla.geckoview.test | 	at org.mozilla.geckoview.test.rule.GeckoSessionTestRule.checkThat(GeckoSessionTestRule.java:826)
[task 2020-09-28T17:11:31.786Z] 17:11:31     INFO -  org.mozilla.geckoview.test | 	at org.mozilla.geckoview.test.BaseSessionTest.assertThat(BaseSessionTest.kt:89)
[task 2020-09-28T17:11:31.786Z] 17:11:31     INFO -  org.mozilla.geckoview.test | 	at org.mozilla.geckoview.test.ContentBlockingControllerTest.safeBrowsingSettings(ContentBlockingControllerTest.kt:203)
[task 2020-09-28T17:11:31.786Z] 17:11:31     INFO -  org.mozilla.geckoview.test | 	at java.lang.reflect.Method.invoke(Native Method)
[task 2020-09-28T17:11:31.786Z] 17:11:31     INFO -  org.mozilla.geckoview.test | 	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
[task 2020-09-28T17:11:31.786Z] 17:11:31     INFO -  org.mozilla.geckoview.test | 	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
[task 2020-09-28T17:11:31.787Z] 17:11:31     INFO -  org.mozilla.geckoview.test | 	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
[task 2020-09-28T17:11:31.787Z] 17:11:31     INFO -  org.mozilla.geckoview.test | 	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
[task 2020-09-28T17:11:31.787Z] 17:11:31     INFO -  org.mozilla.geckoview.test | 	at org.mozilla.geckoview.test.rule.GeckoSessionTestRule$2.lambda$evaluate$0$GeckoSessionTestRule$2(GeckoSessionTestRule.java:1313)
[task 2020-09-28T17:11:31.787Z] 17:11:31     INFO -  org.mozilla.geckoview.test | 	at org.mozilla.geckoview.test.rule.-$$Lambda$GeckoSessionTestRule$2$sIbRNaZJgAu-QrUVWSGD8JbPSWM.run(lambda)
[task 2020-09-28T17:11:31.787Z] 17:11:31     INFO -  org.mozilla.geckoview.test | 	at android.app.Instrumentation$SyncRunnable.run(Instrumentation.java:1950)
[task 2020-09-28T17:11:31.787Z] 17:11:31     INFO -  org.mozilla.geckoview.test | 	at android.os.Handler.handleCallback(Handler.java:751)
[task 2020-09-28T17:11:31.788Z] 17:11:31     INFO -  org.mozilla.geckoview.test | 	at android.os.Handler.dispatchMessage(Handler.java:95)
[task 2020-09-28T17:11:31.788Z] 17:11:31     INFO -  org.mozilla.geckoview.test | 	at android.os.Looper.loop(Looper.java:154)
[task 2020-09-28T17:11:31.788Z] 17:11:31     INFO -  org.mozilla.geckoview.test | 	at android.app.ActivityThread.main(ActivityThread.java:6077)
[task 2020-09-28T17:11:31.788Z] 17:11:31     INFO -  org.mozilla.geckoview.test | 	at java.lang.reflect.Method.invoke(Native Method)
[task 2020-09-28T17:11:31.788Z] 17:11:31     INFO -  org.mozilla.geckoview.test | 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
[task 2020-09-28T17:11:31.788Z] 17:11:31     INFO -  org.mozilla.geckoview.test | 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
[task 2020-09-28T17:11:31.788Z] 17:11:31     INFO -  org.mozilla.geckoview.test |
[task 2020-09-28T17:11:31.789Z] 17:11:31     INFO -  org.mozilla.geckoview.test | INSTRUMENTATION_STATUS: current=51
[task 2020-09-28T17:11:31.789Z] 17:11:31     INFO -  org.mozilla.geckoview.test | INSTRUMENTATION_STATUS_CODE: -2
[task 2020-09-28T17:11:31.789Z] 17:11:31  WARNING -  TEST-UNEXPECTED-FAIL | org.mozilla.geckoview.test.ContentBlockingControllerTest.safeBrowsingSettings | java.lang.AssertionError: Pref value is set correctly
[task 2020-09-28T17:11:31.789Z] 17:11:31     INFO -  TEST-INFO took 107ms
Flags: needinfo?(agi)

This allows the test app to set some settings based on the test server address,
e.g. tests need to be able to override safebrowsing's test URLs once we move
those settings to a GeckoRuntimeSetting in a later patch.

When collecting prefs from a RuntimeSettings we only consider children of the
instance. This change makes it so we traverse the whole tree, collecting
childrens of children, etc.

Thanks.

Flags: needinfo?(agi)
Pushed by asferro@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/377777e17957
Traverse children of arbitrary degree in RuntimeSettings. r=snorp
https://hg.mozilla.org/integration/autoland/rev/be52a545a986
Add GeckoRuntimeSetting for SafeBrowsing provider. r=droeh,dimi,snorp
Status: NEW → RESOLVED
Closed: 23 days ago
Resolution: --- → FIXED
Target Milestone: --- → 83 Branch
Attachment #9178350 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.