There were compiler errors while I added a gtest testcase.
This patch updates the Test* files to include a common header, remove redundant headers,
and include missing headers.
Differential Revision: https://phabricator.services.mozilla.com/D49880
A LazyIdle thread should be created and removed by the same thread. This
patch fixes testcases that trigger the assertion.
Depends on D49874
Differential Revision: https://phabricator.services.mozilla.com/D49875
Safe Browsing update thread wakes up every 30 mins to update tables from google
and 60 mins to update tables from mozilla.
Since the update thread doesn't have always to be alive, we change the
update thread to be a LazyIdle thread instead.
Differential Revision: https://phabricator.services.mozilla.com/D49874
Most of these tests have been disabled for a long time; they run well
in the current test environment.
This completes my review of skipped Android tests.
Differential Revision: https://phabricator.services.mozilla.com/D49954
To make us pass flash blocking testcases when fission is enabled, we should use
SpecialPowers.spawn instead of ContentTask.spawn because the iframes in the testcases
may be cross-origin iframes.
Differential Revision: https://phabricator.services.mozilla.com/D49388
Bug 1329593 introduced this for the mingw-gcc build; but we no longer support this
build and mingw-clang does not need it.
Differential Revision: https://phabricator.services.mozilla.com/D48606
Top-level URL and third-party URL can be an IP address, remove
IsCanonicalizedIP assertion and do not fragment a domain when the domain is an IP address
Differential Revision: https://phabricator.services.mozilla.com/D47916
This patch does the following to support matching a whitelisted URI when
its domain is eTLD+1:
1. add an URIType to indicate whether a URI is generated by
UrlClassifierCommoon::CreatePairwiseWhiteListURI(), which crafts a
whitelist URL like "toplevel.page/?resource=third.party.domain"
2. call LookupCache::GetLookupWhitelistFragments() if URIType is
nsIUrlClassifierFeature::pairwiseWhitelistedURI before initiating
a lookup.
3. implement LookupCache::GetLookupWhitelistFragments() which creates
an additional fragment by removing the leading component of
third.party.domain
Differential Revision: https://phabricator.services.mozilla.com/D47212
This patch replaces |ResetTables|(clear table's in-memory and on-disk
data) with |DeleteTables|(clear table's on-disk data) in GetLookupCache to avoid infinite
loop.
We can just delete on-disk data when file corruption is detected in |GetLookupCache|
without clearing the cache's internal data and refreshing current
active caches because in that scenario, the lookup cache failing to read
database has not yet added to the active caches list.
Differential Revision: https://phabricator.services.mozilla.com/D43181
Before this patch, when Safe Browsing updating process discovers an error, it
quits and resets the table failing to update.
After this patch, updating process will continue to run when an error
occurs to find all the tables failing to apply an update.
Differential Revision: https://phabricator.services.mozilla.com/D42615
Patch P2 & P3 refine how Safe Browsing handles Safe Browsing database
loading failure.
Safe Browsing databases are read in 3 scenarios:
1. |GetLookupCache| is called on startup. Safe Browsing reads prefix
files in this case. Metadata for updates(.sbstore, .metadata) are not
read in this scenario.
2. |TableRequest| is called before applying an update, Safe Browsing
reads update metadata to apply a partial update.
3. During an update, Safe Browsing reads both prefix files and metadata
in order to merge the update result.
For Case 1, we reset a table's database only when it returns FILE_CORRUPTED
while loading prefixes from the prefix file(.vlpset).
For Case 2, we reset a table's database when the table fails to load its
metadata file or prefix file. This is because we need to make sure both
files are complete so we can correctly perform a partial update.
Note that in this case, we don't just reset the database when "FILE_CORRUPTED"
is detected, we reset the database as long as an error occurs while loading the
database.
For Case 3, For all the tables failing to load their database during an
updating process, the databases of those tables will be reset.
Case 1 and Case 2 are done in Patch P2; Case 3 is done in Patch P3
Differential Revision: https://phabricator.services.mozilla.com/D42614
mInputStream holds a reference to the current opened HashStore file.
While resetting the file, mInputStream should be closed first, otherwise,
the file->Remove returns failure code NS_ERROR_FILE_IS_LOCKED.
(This only happens in Windows platform)
Differential Revision: https://phabricator.services.mozilla.com/D42460
Refactor the gtest code because it confused me while adding new tests.
This patch focus on refining utility function but it also contains other
minor refinements.
Changes includes:
1. Add comments to utility function
2. Move common utility functions to Common.cpp and remove duplicates
3. Header file removal and reorder
4. Unify MPL commnetc
5. Replace anonymouse namespace with static function
Differential Revision: https://phabricator.services.mozilla.com/D37532
Refactor the gtest code because it confused me while adding new tests.
This patch focus on refining utility function but it also contains other
minor refinements.
Changes includes:
1. Add comments to utility function
2. Move common utility functions to Common.cpp and remove duplicates
3. Header file removal and reorder
4. Unify MPL commnetc
5. Replace anonymouse namespace with static function
Differential Revision: https://phabricator.services.mozilla.com/D37532
While listmanager called |kickoffUpdate|, it used to call |GetTables| to
retrieve update information and used the information to distinguish if
a table is a "existing" table or not.
In Bug 1045163, the "existing table" logic was removed, which also means we
don't need to call |GetTabkes| anymore. This patch removes calling
Classifier::TableRequest to reduce unnecessary disk IO during startup.
Differential Revision: https://phabricator.services.mozilla.com/D37037
This requires replacing inclusions of it with inclusions of more specific prefs
files.
The exception is that StaticPrefsAll.h, which is equivalent to StaticPrefs.h,
and is used in `Codegen.py` because doing something smarter is tricky and
suitable for a follow-up. As a result, any change to StaticPrefList.yaml will
still trigger recompilation of all the generated DOM bindings files, but that's
still a big improvement over trigger recompilation of every file that uses
static prefs.
Most of the changes in this commit are very boring. The only changes that are
not boring are modules/libpref/*, Codegen.py, and ServoBindings.toml.
Differential Revision: https://phabricator.services.mozilla.com/D39138
When a test crashes, the harness skips all of the remaining tests in the
directory. That means that with crashes skipped, we now try to run a whole lot
more tests than we did before, and a lot of them fail under Fission.
This patch adds annotations to the new failures that show up after part 1.
Differential Revision: https://phabricator.services.mozilla.com/D38726
My preference was to annotate most of the failing tests with `fail-if` so that
if they start passing, the `fail-if` needs to be removed and they need to keep
passing. That doesn't work for tests that timeout, or which trigger failures
from their cleanup functions, however, so those tests need skip-if. And tests
with fail in their cleanup functions likely leave the browser in an
inconsistent state for subsequent tests, anyway, so really should be skipped
regardless.
There are some remaining tests which still fail because of crashes. I chose
not to skip them here, but to fix the crashes in separate bugs instead.
Differential Revision: https://phabricator.services.mozilla.com/D38247
This patches only allows Safe Browsing to download the list, but the feature
is still default disabled and the lists will not be downloaded.
Turn on social tracking by setting:
"privacy.trackingprotection.socialtracking.enabled"
"privacy.trackingprotection.socialtracking.annotate.enabled"
Differential Revision: https://phabricator.services.mozilla.com/D37410