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 "chrome/test/base/in_process_browser_test.h" | 5 #include "chrome/test/base/in_process_browser_test.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/stack_trace.h" | 10 #include "base/debug/stack_trace.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 #include "chrome/common/logging_chrome.h" | 30 #include "chrome/common/logging_chrome.h" |
31 #include "chrome/common/url_constants.h" | 31 #include "chrome/common/url_constants.h" |
32 #include "chrome/renderer/chrome_content_renderer_client.h" | 32 #include "chrome/renderer/chrome_content_renderer_client.h" |
33 #include "chrome/test/base/chrome_test_suite.h" | 33 #include "chrome/test/base/chrome_test_suite.h" |
34 #include "chrome/test/base/test_launcher_utils.h" | 34 #include "chrome/test/base/test_launcher_utils.h" |
35 #include "chrome/test/base/testing_browser_process.h" | 35 #include "chrome/test/base/testing_browser_process.h" |
36 #include "chrome/test/base/ui_test_utils.h" | 36 #include "chrome/test/base/ui_test_utils.h" |
37 #include "content/public/browser/notification_service.h" | 37 #include "content/public/browser/notification_service.h" |
38 #include "content/public/browser/notification_types.h" | 38 #include "content/public/browser/notification_types.h" |
39 #include "content/public/browser/render_process_host.h" | 39 #include "content/public/browser/render_process_host.h" |
| 40 #include "content/public/test/browser_test_utils.h" |
40 #include "content/public/test/test_browser_thread.h" | 41 #include "content/public/test/test_browser_thread.h" |
41 #include "content/public/test/test_launcher.h" | 42 #include "content/public/test/test_launcher.h" |
42 #include "net/base/mock_host_resolver.h" | 43 #include "net/base/mock_host_resolver.h" |
43 #include "net/test/test_server.h" | 44 #include "net/test/test_server.h" |
44 #include "ui/compositor/compositor_switches.h" | 45 #include "ui/compositor/compositor_switches.h" |
45 | 46 |
46 #if defined(OS_CHROMEOS) | 47 #if defined(OS_CHROMEOS) |
47 #include "chrome/browser/chromeos/audio/audio_handler.h" | 48 #include "chrome/browser/chromeos/audio/audio_handler.h" |
48 #elif defined(OS_MACOSX) | 49 #elif defined(OS_MACOSX) |
49 #include "base/mac/scoped_nsautorelease_pool.h" | 50 #include "base/mac/scoped_nsautorelease_pool.h" |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 | 328 |
328 // Pump startup related events. | 329 // Pump startup related events. |
329 ui_test_utils::RunAllPendingInMessageLoop(); | 330 ui_test_utils::RunAllPendingInMessageLoop(); |
330 | 331 |
331 #if defined(OS_MACOSX) | 332 #if defined(OS_MACOSX) |
332 autorelease_pool_->Recycle(); | 333 autorelease_pool_->Recycle(); |
333 #endif | 334 #endif |
334 | 335 |
335 if (!BrowserList::empty()) { | 336 if (!BrowserList::empty()) { |
336 browser_ = *BrowserList::begin(); | 337 browser_ = *BrowserList::begin(); |
337 ui_test_utils::WaitForLoadStop(chrome::GetActiveWebContents(browser_)); | 338 content::WaitForLoadStop(chrome::GetActiveWebContents(browser_)); |
338 } | 339 } |
339 | 340 |
340 // Pump any pending events that were created as a result of creating a | 341 // Pump any pending events that were created as a result of creating a |
341 // browser. | 342 // browser. |
342 ui_test_utils::RunAllPendingInMessageLoop(); | 343 ui_test_utils::RunAllPendingInMessageLoop(); |
343 | 344 |
344 SetUpOnMainThread(); | 345 SetUpOnMainThread(); |
345 #if defined(OS_MACOSX) | 346 #if defined(OS_MACOSX) |
346 autorelease_pool_->Recycle(); | 347 autorelease_pool_->Recycle(); |
347 #endif | 348 #endif |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 // On the Mac, this eventually reaches | 389 // On the Mac, this eventually reaches |
389 // -[BrowserWindowController windowWillClose:], which will post a deferred | 390 // -[BrowserWindowController windowWillClose:], which will post a deferred |
390 // -autorelease on itself to ultimately destroy the Browser object. The line | 391 // -autorelease on itself to ultimately destroy the Browser object. The line |
391 // below is necessary to pump these pending messages to ensure all Browsers | 392 // below is necessary to pump these pending messages to ensure all Browsers |
392 // get deleted. | 393 // get deleted. |
393 ui_test_utils::RunAllPendingInMessageLoop(); | 394 ui_test_utils::RunAllPendingInMessageLoop(); |
394 delete autorelease_pool_; | 395 delete autorelease_pool_; |
395 autorelease_pool_ = NULL; | 396 autorelease_pool_ = NULL; |
396 #endif | 397 #endif |
397 } | 398 } |
OLD | NEW |