OLD | NEW |
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 #include "base/prefs/pref_service.h" | 5 #include "base/prefs/pref_service.h" |
6 #include "base/strings/utf_string_conversions.h" | 6 #include "base/strings/utf_string_conversions.h" |
7 #include "chrome/browser/browser_process.h" | 7 #include "chrome/browser/browser_process.h" |
8 #include "chrome/browser/chrome_notification_types.h" | 8 #include "chrome/browser/chrome_notification_types.h" |
9 #include "chrome/browser/extensions/extension_apitest.h" | 9 #include "chrome/browser/extensions/extension_apitest.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 EXPECT_FALSE(prefs->GetBoolean(prefs::kEnableHyperlinkAuditing)); | 62 EXPECT_FALSE(prefs->GetBoolean(prefs::kEnableHyperlinkAuditing)); |
63 EXPECT_FALSE(prefs->GetBoolean(prefs::kEnableReferrers)); | 63 EXPECT_FALSE(prefs->GetBoolean(prefs::kEnableReferrers)); |
64 EXPECT_FALSE(prefs->GetBoolean(prefs::kEnableTranslate)); | 64 EXPECT_FALSE(prefs->GetBoolean(prefs::kEnableTranslate)); |
65 EXPECT_FALSE(prefs->GetBoolean(prefs::kNetworkPredictionEnabled)); | 65 EXPECT_FALSE(prefs->GetBoolean(prefs::kNetworkPredictionEnabled)); |
66 EXPECT_FALSE(prefs->GetBoolean( | 66 EXPECT_FALSE(prefs->GetBoolean( |
67 password_manager::prefs::kPasswordManagerSavingEnabled)); | 67 password_manager::prefs::kPasswordManagerSavingEnabled)); |
68 EXPECT_FALSE(prefs->GetBoolean(prefs::kSafeBrowsingEnabled)); | 68 EXPECT_FALSE(prefs->GetBoolean(prefs::kSafeBrowsingEnabled)); |
69 EXPECT_FALSE(prefs->GetBoolean(prefs::kSearchSuggestEnabled)); | 69 EXPECT_FALSE(prefs->GetBoolean(prefs::kSearchSuggestEnabled)); |
70 } | 70 } |
71 | 71 |
72 virtual void SetUpOnMainThread() OVERRIDE { | 72 virtual void SetUpOnMainThread() override { |
73 ExtensionApiTest::SetUpOnMainThread(); | 73 ExtensionApiTest::SetUpOnMainThread(); |
74 | 74 |
75 // The browser might get closed later (and therefore be destroyed), so we | 75 // The browser might get closed later (and therefore be destroyed), so we |
76 // save the profile. | 76 // save the profile. |
77 profile_ = browser()->profile(); | 77 profile_ = browser()->profile(); |
78 | 78 |
79 // Closing the last browser window also releases a module reference. Make | 79 // Closing the last browser window also releases a module reference. Make |
80 // sure it's not the last one, so the message loop doesn't quit | 80 // sure it's not the last one, so the message loop doesn't quit |
81 // unexpectedly. | 81 // unexpectedly. |
82 g_browser_process->AddRefModule(); | 82 g_browser_process->AddRefModule(); |
83 } | 83 } |
84 | 84 |
85 virtual void TearDownOnMainThread() OVERRIDE { | 85 virtual void TearDownOnMainThread() override { |
86 // ReleaseBrowserProcessModule() needs to be called in a message loop, so we | 86 // ReleaseBrowserProcessModule() needs to be called in a message loop, so we |
87 // post a task to do it, then run the message loop. | 87 // post a task to do it, then run the message loop. |
88 base::MessageLoop::current()->PostTask( | 88 base::MessageLoop::current()->PostTask( |
89 FROM_HERE, base::Bind(&ReleaseBrowserProcessModule)); | 89 FROM_HERE, base::Bind(&ReleaseBrowserProcessModule)); |
90 content::RunAllPendingInMessageLoop(); | 90 content::RunAllPendingInMessageLoop(); |
91 | 91 |
92 ExtensionApiTest::TearDownOnMainThread(); | 92 ExtensionApiTest::TearDownOnMainThread(); |
93 } | 93 } |
94 | 94 |
95 Profile* profile_; | 95 Profile* profile_; |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 | 319 |
320 // Test 6 - clearDefault | 320 // Test 6 - clearDefault |
321 EXPECT_TRUE(listener10.WaitUntilSatisfied()); // Regular ready | 321 EXPECT_TRUE(listener10.WaitUntilSatisfied()); // Regular ready |
322 EXPECT_TRUE(listener_incognito10.WaitUntilSatisfied()); // Incognito ready | 322 EXPECT_TRUE(listener_incognito10.WaitUntilSatisfied()); // Incognito ready |
323 listener10.Reply("ok"); | 323 listener10.Reply("ok"); |
324 listener_incognito10.Reply("ok"); | 324 listener_incognito10.Reply("ok"); |
325 | 325 |
326 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); | 326 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); |
327 EXPECT_TRUE(catcher_incognito.GetNextResult()) << catcher.message(); | 327 EXPECT_TRUE(catcher_incognito.GetNextResult()) << catcher.message(); |
328 } | 328 } |
OLD | NEW |