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

Side by Side Diff: chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc

Issue 933503004: Always load signin profile on Chrome OS startup. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rollback unnecessary changes. Created 5 years, 10 months 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 unified diff | Download patch
OLDNEW
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 // This test creates a safebrowsing service using test safebrowsing database 5 // This test creates a safebrowsing service using test safebrowsing database
6 // and a test protocol manager. It is used to test logics in safebrowsing 6 // and a test protocol manager. It is used to test logics in safebrowsing
7 // service. 7 // service.
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 30 matching lines...) Expand all
41 #include "chrome/common/pref_names.h" 41 #include "chrome/common/pref_names.h"
42 #include "chrome/test/base/in_process_browser_test.h" 42 #include "chrome/test/base/in_process_browser_test.h"
43 #include "chrome/test/base/ui_test_utils.h" 43 #include "chrome/test/base/ui_test_utils.h"
44 #include "content/public/browser/web_contents.h" 44 #include "content/public/browser/web_contents.h"
45 #include "net/cookies/cookie_store.h" 45 #include "net/cookies/cookie_store.h"
46 #include "sql/connection.h" 46 #include "sql/connection.h"
47 #include "sql/statement.h" 47 #include "sql/statement.h"
48 #include "testing/gmock/include/gmock/gmock.h" 48 #include "testing/gmock/include/gmock/gmock.h"
49 49
50 #if defined(OS_CHROMEOS) 50 #if defined(OS_CHROMEOS)
51 #include "chrome/browser/chromeos/profiles/profile_helper.h"
51 #include "chromeos/chromeos_switches.h" 52 #include "chromeos/chromeos_switches.h"
52 #endif 53 #endif
53 54
54 using content::BrowserThread; 55 using content::BrowserThread;
55 using content::InterstitialPage; 56 using content::InterstitialPage;
56 using content::WebContents; 57 using content::WebContents;
57 using ::testing::_; 58 using ::testing::_;
58 using ::testing::Mock; 59 using ::testing::Mock;
59 using ::testing::StrictMock; 60 using ::testing::StrictMock;
60 61
(...skipping 959 matching lines...) Expand 10 before | Expand all | Expand 10 after
1020 1021
1021 // Change one of the prefs. SBS should keep running. 1022 // Change one of the prefs. SBS should keep running.
1022 pref_service->SetBoolean(prefs::kSafeBrowsingEnabled, false); 1023 pref_service->SetBoolean(prefs::kSafeBrowsingEnabled, false);
1023 WaitForIOThread(); 1024 WaitForIOThread();
1024 EXPECT_TRUE(sb_service->enabled()); 1025 EXPECT_TRUE(sb_service->enabled());
1025 EXPECT_TRUE(csd_service->enabled()); 1026 EXPECT_TRUE(csd_service->enabled());
1026 1027
1027 // Change the other pref. SBS should stop now. 1028 // Change the other pref. SBS should stop now.
1028 pref_service2->SetBoolean(prefs::kSafeBrowsingEnabled, false); 1029 pref_service2->SetBoolean(prefs::kSafeBrowsingEnabled, false);
1029 WaitForIOThread(); 1030 WaitForIOThread();
1031 #if defined(OS_CHROMEOS)
1032 // On Chrome OS we should disable safe browsing for signin profile.
mattm 2015/02/17 23:13:06 Comment seemed a little confusing. Is "On Chrome O
Ivan Podogov 2015/02/18 09:03:30 Signin profile loads first thing during boot-up an
Nikita (slow) 2015/02/19 14:48:09 To clarify what Ivan said, signin profile is in fa
mattm 2015/02/24 20:39:06 Okay, I verified that is the case and filed https:
Ivan Podogov 2015/02/25 11:11:03 Done.
1033 EXPECT_TRUE(sb_service->enabled());
1034 EXPECT_TRUE(csd_service->enabled());
1035 chromeos::ProfileHelper::GetSigninProfile()
1036 ->GetOriginalProfile()
1037 ->GetPrefs()
1038 ->SetBoolean(prefs::kSafeBrowsingEnabled, false);
1039 WaitForIOThread();
1040 #endif
1030 EXPECT_FALSE(sb_service->enabled()); 1041 EXPECT_FALSE(sb_service->enabled());
1031 EXPECT_FALSE(csd_service->enabled()); 1042 EXPECT_FALSE(csd_service->enabled());
1032 1043
1033 // Turn it back on. SBS comes back. 1044 // Turn it back on. SBS comes back.
1034 pref_service2->SetBoolean(prefs::kSafeBrowsingEnabled, true); 1045 pref_service2->SetBoolean(prefs::kSafeBrowsingEnabled, true);
1035 WaitForIOThread(); 1046 WaitForIOThread();
1036 EXPECT_TRUE(sb_service->enabled()); 1047 EXPECT_TRUE(sb_service->enabled());
1037 EXPECT_TRUE(csd_service->enabled()); 1048 EXPECT_TRUE(csd_service->enabled());
1038 1049
1039 // Delete the Profile. SBS stops again. 1050 // Delete the Profile. SBS stops again.
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
1236 content::WindowedNotificationObserver observer( 1247 content::WindowedNotificationObserver observer(
1237 chrome::NOTIFICATION_SAFE_BROWSING_UPDATE_COMPLETE, 1248 chrome::NOTIFICATION_SAFE_BROWSING_UPDATE_COMPLETE,
1238 content::Source<SafeBrowsingDatabaseManager>( 1249 content::Source<SafeBrowsingDatabaseManager>(
1239 sb_service_->database_manager().get())); 1250 sb_service_->database_manager().get()));
1240 BrowserThread::PostTask( 1251 BrowserThread::PostTask(
1241 BrowserThread::IO, 1252 BrowserThread::IO,
1242 FROM_HERE, 1253 FROM_HERE,
1243 base::Bind(&SafeBrowsingDatabaseManagerCookieTest::ForceUpdate, this)); 1254 base::Bind(&SafeBrowsingDatabaseManagerCookieTest::ForceUpdate, this));
1244 observer.Wait(); 1255 observer.Wait();
1245 } 1256 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698