Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_UI_COCOA_PROFILE_TEST_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_PROFILE_TEST_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_PROFILE_TEST_H_ | 6 #define CHROME_BROWSER_UI_COCOA_PROFILE_TEST_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" | 9 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" |
| 10 #include "chrome/test/base/testing_profile_manager.h" | 10 #include "chrome/test/base/testing_profile_manager.h" |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 26 // would never be deleted and would report as a leak under Valgrind. Note that | 26 // would never be deleted and would report as a leak under Valgrind. Note that |
| 27 // these are fake threads and they all share the same MessageLoop. | 27 // these are fake threads and they all share the same MessageLoop. |
| 28 // | 28 // |
| 29 // TODO(jrg): move up a level (chrome/browser/ui/cocoa --> | 29 // TODO(jrg): move up a level (chrome/browser/ui/cocoa --> |
| 30 // chrome/browser), and use in non-Mac unit tests such as | 30 // chrome/browser), and use in non-Mac unit tests such as |
| 31 // back_forward_menu_model_unittest.cc, | 31 // back_forward_menu_model_unittest.cc, |
| 32 // navigation_controller_unittest.cc, .. | 32 // navigation_controller_unittest.cc, .. |
| 33 class CocoaProfileTest : public CocoaTest { | 33 class CocoaProfileTest : public CocoaTest { |
| 34 public: | 34 public: |
| 35 CocoaProfileTest(); | 35 CocoaProfileTest(); |
| 36 CocoaProfileTest(bool incognito); | |
|
Robert Sesek
2015/09/28 15:14:47
Is this change to CocoaProfileTest really necessar
anthonyvd
2015/09/29 20:23:15
I would end up pretty much copy-pasting the CocoaP
Robert Sesek
2015/09/29 20:31:11
You can still inherit from CocoaProfileTest, but y
anthonyvd
2015/09/30 18:34:03
Fair point, done. I don't have access to my mac so
| |
| 36 ~CocoaProfileTest() override; | 37 ~CocoaProfileTest() override; |
| 37 | 38 |
| 38 // This constructs a a Browser and a TestingProfile. It is guaranteed to | 39 // This constructs a a Browser and a TestingProfile. It is guaranteed to |
| 39 // succeed, else it will ASSERT and cause the test to fail. Subclasses that | 40 // succeed, else it will ASSERT and cause the test to fail. Subclasses that |
| 40 // do work in SetUp should ASSERT that either browser() or profile() are | 41 // do work in SetUp should ASSERT that either browser() or profile() are |
| 41 // non-NULL before proceeding after the call to super (this). | 42 // non-NULL before proceeding after the call to super (this). |
| 42 void SetUp() override; | 43 void SetUp() override; |
| 43 | 44 |
| 44 void TearDown() override; | 45 void TearDown() override; |
| 45 | 46 |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 65 | 66 |
| 66 const TestingProfile::TestingFactories& testing_factories() { | 67 const TestingProfile::TestingFactories& testing_factories() { |
| 67 return testing_factories_; | 68 return testing_factories_; |
| 68 } | 69 } |
| 69 | 70 |
| 70 private: | 71 private: |
| 71 TestingProfileManager profile_manager_; | 72 TestingProfileManager profile_manager_; |
| 72 TestingProfile* profile_; // Weak; owned by profile_manager_. | 73 TestingProfile* profile_; // Weak; owned by profile_manager_. |
| 73 TestingProfile::TestingFactories testing_factories_; | 74 TestingProfile::TestingFactories testing_factories_; |
| 74 scoped_ptr<Browser> browser_; | 75 scoped_ptr<Browser> browser_; |
| 76 bool incognito_; | |
| 75 | 77 |
| 76 scoped_ptr<content::TestBrowserThreadBundle> thread_bundle_; | 78 scoped_ptr<content::TestBrowserThreadBundle> thread_bundle_; |
| 77 }; | 79 }; |
| 78 | 80 |
| 79 #endif // CHROME_BROWSER_UI_COCOA_PROFILE_TEST_H_ | 81 #endif // CHROME_BROWSER_UI_COCOA_PROFILE_TEST_H_ |
| OLD | NEW |