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/feature_list.h" | 10 #include "base/feature_list.h" |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 return error_message->empty(); | 332 return error_message->empty(); |
333 } | 333 } |
334 | 334 |
335 bool InProcessBrowserTest::CreateUserDataDirectory() { | 335 bool InProcessBrowserTest::CreateUserDataDirectory() { |
336 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 336 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
337 base::FilePath user_data_dir = | 337 base::FilePath user_data_dir = |
338 command_line->GetSwitchValuePath(switches::kUserDataDir); | 338 command_line->GetSwitchValuePath(switches::kUserDataDir); |
339 if (user_data_dir.empty()) { | 339 if (user_data_dir.empty()) { |
340 if (temp_user_data_dir_.CreateUniqueTempDir() && | 340 if (temp_user_data_dir_.CreateUniqueTempDir() && |
341 temp_user_data_dir_.IsValid()) { | 341 temp_user_data_dir_.IsValid()) { |
342 user_data_dir = temp_user_data_dir_.path(); | 342 user_data_dir = temp_user_data_dir_.GetPath(); |
343 } else { | 343 } else { |
344 LOG(ERROR) << "Could not create temporary user data directory \"" | 344 LOG(ERROR) << "Could not create temporary user data directory \"" |
345 << temp_user_data_dir_.path().value() << "\"."; | 345 << temp_user_data_dir_.GetPath().value() << "\"."; |
346 return false; | 346 return false; |
347 } | 347 } |
348 } | 348 } |
349 return test_launcher_utils::OverrideUserDataDir(user_data_dir); | 349 return test_launcher_utils::OverrideUserDataDir(user_data_dir); |
350 } | 350 } |
351 | 351 |
352 void InProcessBrowserTest::TearDown() { | 352 void InProcessBrowserTest::TearDown() { |
353 DCHECK(!g_browser_process); | 353 DCHECK(!g_browser_process); |
354 #if defined(OS_WIN) | 354 #if defined(OS_WIN) |
355 com_initializer_.reset(); | 355 com_initializer_.reset(); |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
606 // On the Mac, this eventually reaches | 606 // On the Mac, this eventually reaches |
607 // -[BrowserWindowController windowWillClose:], which will post a deferred | 607 // -[BrowserWindowController windowWillClose:], which will post a deferred |
608 // -autorelease on itself to ultimately destroy the Browser object. The line | 608 // -autorelease on itself to ultimately destroy the Browser object. The line |
609 // below is necessary to pump these pending messages to ensure all Browsers | 609 // below is necessary to pump these pending messages to ensure all Browsers |
610 // get deleted. | 610 // get deleted. |
611 content::RunAllPendingInMessageLoop(); | 611 content::RunAllPendingInMessageLoop(); |
612 delete autorelease_pool_; | 612 delete autorelease_pool_; |
613 autorelease_pool_ = NULL; | 613 autorelease_pool_ = NULL; |
614 #endif | 614 #endif |
615 } | 615 } |
OLD | NEW |