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

Unified Diff: chrome/browser/supervised_user/supervised_user_whitelist_service_unittest.cc

Issue 1443033004: Supervised User whitelists: update to json format v2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove l10n Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/supervised_user/supervised_user_whitelist_service_unittest.cc
diff --git a/chrome/browser/supervised_user/supervised_user_whitelist_service_unittest.cc b/chrome/browser/supervised_user/supervised_user_whitelist_service_unittest.cc
index 1ae9984b7cab006349d8d99fd54ed4a4ece81e2f..96e6c26cc4fbf0ce64ede3a7193dc8b49cbfe8d4 100644
--- a/chrome/browser/supervised_user/supervised_user_whitelist_service_unittest.cc
+++ b/chrome/browser/supervised_user/supervised_user_whitelist_service_unittest.cc
@@ -46,9 +46,10 @@ class MockSupervisedUserWhitelistInstaller
}
void NotifyWhitelistReady(const std::string& crx_id,
+ const base::string16& title,
const base::FilePath& path) {
for (const auto& callback : ready_callbacks_)
- callback.Run(crx_id, path);
+ callback.Run(crx_id, title, path);
}
// SupervisedUserWhitelistInstaller implementation:
@@ -197,14 +198,13 @@ TEST_F(SupervisedUserWhitelistServiceTest, MergeExisting) {
ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir));
base::FilePath whitelist_path =
test_data_dir.AppendASCII("whitelists/content_pack/site_list.json");
- installer_->NotifyWhitelistReady("aaaa", whitelist_path);
+ installer_->NotifyWhitelistReady("aaaa", base::ASCIIToUTF16("Title"),
+ whitelist_path);
run_loop.Run();
ASSERT_EQ(1u, site_lists_.size());
- const std::vector<SupervisedUserSiteList::Site>& sites =
- site_lists_[0]->sites();
- EXPECT_EQ(3u, sites.size());
- EXPECT_EQ("YouTube", base::UTF16ToUTF8(sites[0].name));
+ EXPECT_EQ(base::ASCIIToUTF16("Title"), site_lists_[0]->title());
+ EXPECT_EQ(4u, site_lists_[0]->patterns().size());
// Do the initial merge. One item should be added (whitelist C), one should be
// modified (whitelist B), and one item should be removed (whitelist A).
@@ -259,7 +259,8 @@ TEST_F(SupervisedUserWhitelistServiceTest, ApplyChanges) {
// If whitelist A now becomes ready, it should be ignored.
installer_->NotifyWhitelistReady(
- "aaaa", base::FilePath(FILE_PATH_LITERAL("/path/to/aaaa")));
+ "aaaa", base::ASCIIToUTF16("Title"),
+ base::FilePath(FILE_PATH_LITERAL("/path/to/aaaa")));
EXPECT_EQ(0u, site_lists_.size());
CheckFinalStateAndPreferences();

Powered by Google App Engine
This is Rietveld 408576698