| 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/extensions/extension_test_message_listener.h" | 10 #include "chrome/browser/extensions/extension_test_message_listener.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 // The browser might get closed later (and therefore be destroyed), so we | 74 // The browser might get closed later (and therefore be destroyed), so we |
| 75 // save the profile. | 75 // save the profile. |
| 76 profile_ = browser()->profile(); | 76 profile_ = browser()->profile(); |
| 77 | 77 |
| 78 // Closing the last browser window also releases a module reference. Make | 78 // Closing the last browser window also releases a module reference. Make |
| 79 // sure it's not the last one, so the message loop doesn't quit | 79 // sure it's not the last one, so the message loop doesn't quit |
| 80 // unexpectedly. | 80 // unexpectedly. |
| 81 g_browser_process->AddRefModule(); | 81 g_browser_process->AddRefModule(); |
| 82 } | 82 } |
| 83 | 83 |
| 84 virtual void CleanUpOnMainThread() OVERRIDE { | 84 virtual void TearDownOnMainThread() OVERRIDE { |
| 85 // ReleaseBrowserProcessModule() needs to be called in a message loop, so we | 85 // ReleaseBrowserProcessModule() needs to be called in a message loop, so we |
| 86 // post a task to do it, then run the message loop. | 86 // post a task to do it, then run the message loop. |
| 87 base::MessageLoop::current()->PostTask( | 87 base::MessageLoop::current()->PostTask( |
| 88 FROM_HERE, base::Bind(&ReleaseBrowserProcessModule)); | 88 FROM_HERE, base::Bind(&ReleaseBrowserProcessModule)); |
| 89 content::RunAllPendingInMessageLoop(); | 89 content::RunAllPendingInMessageLoop(); |
| 90 | 90 |
| 91 ExtensionApiTest::CleanUpOnMainThread(); | 91 ExtensionApiTest::TearDownOnMainThread(); |
| 92 } | 92 } |
| 93 | 93 |
| 94 Profile* profile_; | 94 Profile* profile_; |
| 95 }; | 95 }; |
| 96 | 96 |
| 97 // http://crbug.com/177163 | 97 // http://crbug.com/177163 |
| 98 #if defined(OS_WIN) && !defined(NDEBUG) | 98 #if defined(OS_WIN) && !defined(NDEBUG) |
| 99 #define MAYBE_Standard DISABLED_Standard | 99 #define MAYBE_Standard DISABLED_Standard |
| 100 #else | 100 #else |
| 101 #define MAYBE_Standard Standard | 101 #define MAYBE_Standard Standard |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 | 316 |
| 317 // Test 6 - clearDefault | 317 // Test 6 - clearDefault |
| 318 EXPECT_TRUE(listener10.WaitUntilSatisfied()); // Regular ready | 318 EXPECT_TRUE(listener10.WaitUntilSatisfied()); // Regular ready |
| 319 EXPECT_TRUE(listener_incognito10.WaitUntilSatisfied()); // Incognito ready | 319 EXPECT_TRUE(listener_incognito10.WaitUntilSatisfied()); // Incognito ready |
| 320 listener10.Reply("ok"); | 320 listener10.Reply("ok"); |
| 321 listener_incognito10.Reply("ok"); | 321 listener_incognito10.Reply("ok"); |
| 322 | 322 |
| 323 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); | 323 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); |
| 324 EXPECT_TRUE(catcher_incognito.GetNextResult()) << catcher.message(); | 324 EXPECT_TRUE(catcher_incognito.GetNextResult()) << catcher.message(); |
| 325 } | 325 } |
| OLD | NEW |