| 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/browser/ui/cocoa/cocoa_profile_test.h" | 5 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" |
| 6 | 6 |
| 7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/browser/autocomplete/autocomplete_classifier_factory.h" | 9 #include "chrome/browser/autocomplete/autocomplete_classifier_factory.h" |
| 10 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 10 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 testing_factories_.push_back(testing_factory); | 49 testing_factories_.push_back(testing_factory); |
| 50 } | 50 } |
| 51 } | 51 } |
| 52 | 52 |
| 53 void CocoaProfileTest::SetUp() { | 53 void CocoaProfileTest::SetUp() { |
| 54 CocoaTest::SetUp(); | 54 CocoaTest::SetUp(); |
| 55 | 55 |
| 56 ASSERT_TRUE(profile_manager_.SetUp()); | 56 ASSERT_TRUE(profile_manager_.SetUp()); |
| 57 | 57 |
| 58 profile_ = profile_manager_.CreateTestingProfile( | 58 profile_ = profile_manager_.CreateTestingProfile( |
| 59 "Person 1", scoped_ptr<syncable_prefs::PrefServiceSyncable>(), | 59 "Person 1", std::unique_ptr<syncable_prefs::PrefServiceSyncable>(), |
| 60 base::UTF8ToUTF16("Person 1"), 0, std::string(), | 60 base::UTF8ToUTF16("Person 1"), 0, std::string(), testing_factories_); |
| 61 testing_factories_); | |
| 62 ASSERT_TRUE(profile_); | 61 ASSERT_TRUE(profile_); |
| 63 | 62 |
| 64 // TODO(shess): These are needed in case someone creates a browser | 63 // TODO(shess): These are needed in case someone creates a browser |
| 65 // window off of browser_. pkasting indicates that other | 64 // window off of browser_. pkasting indicates that other |
| 66 // platforms use a stub |BrowserWindow| and thus don't need to do | 65 // platforms use a stub |BrowserWindow| and thus don't need to do |
| 67 // this. | 66 // this. |
| 68 // http://crbug.com/39725 | 67 // http://crbug.com/39725 |
| 69 TemplateURLServiceFactory::GetInstance()->SetTestingFactoryAndUse( | 68 TemplateURLServiceFactory::GetInstance()->SetTestingFactoryAndUse( |
| 70 profile_, &TemplateURLServiceFactory::BuildInstanceFor); | 69 profile_, &TemplateURLServiceFactory::BuildInstanceFor); |
| 71 AutocompleteClassifierFactory::GetInstance()->SetTestingFactoryAndUse( | 70 AutocompleteClassifierFactory::GetInstance()->SetTestingFactoryAndUse( |
| (...skipping 19 matching lines...) Expand all Loading... |
| 91 DCHECK(browser_->window()); | 90 DCHECK(browser_->window()); |
| 92 browser_->tab_strip_model()->CloseAllTabs(); | 91 browser_->tab_strip_model()->CloseAllTabs(); |
| 93 chrome::CloseWindow(browser_.get()); | 92 chrome::CloseWindow(browser_.get()); |
| 94 // |browser_| will be deleted by its BrowserWindowController. | 93 // |browser_| will be deleted by its BrowserWindowController. |
| 95 ignore_result(browser_.release()); | 94 ignore_result(browser_.release()); |
| 96 } | 95 } |
| 97 | 96 |
| 98 Browser* CocoaProfileTest::CreateBrowser() { | 97 Browser* CocoaProfileTest::CreateBrowser() { |
| 99 return new Browser(Browser::CreateParams(profile())); | 98 return new Browser(Browser::CreateParams(profile())); |
| 100 } | 99 } |
| OLD | NEW |