Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: chrome/test/base/testing_profile.cc

Issue 181403006: Make TestingProfile auto-create incognito profiles. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove broken and no-longer-applicable test Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/testing_profile.h" 5 #include "chrome/test/base/testing_profile.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 8
9 #include "base/base_paths.h" 9 #include "base/base_paths.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 } 591 }
592 592
593 void TestingProfile::SetOriginalProfile(Profile* profile) { 593 void TestingProfile::SetOriginalProfile(Profile* profile) {
594 DCHECK(IsOffTheRecord()); 594 DCHECK(IsOffTheRecord());
595 original_profile_ = profile; 595 original_profile_ = profile;
596 } 596 }
597 597
598 Profile* TestingProfile::GetOffTheRecordProfile() { 598 Profile* TestingProfile::GetOffTheRecordProfile() {
599 if (IsOffTheRecord()) 599 if (IsOffTheRecord())
600 return this; 600 return this;
601 if (!incognito_profile_) {
602 TestingProfile::Builder builder;
603 builder.SetIncognito();
604 scoped_ptr<TestingProfile> incognito_test_profile(builder.Build());
605 incognito_test_profile->SetOriginalProfile(this);
606 SetOffTheRecordProfile(incognito_test_profile.PassAs<Profile>());
607 }
601 return incognito_profile_.get(); 608 return incognito_profile_.get();
602 } 609 }
603 610
604 bool TestingProfile::HasOffTheRecordProfile() { 611 bool TestingProfile::HasOffTheRecordProfile() {
605 return incognito_profile_.get() != NULL; 612 return incognito_profile_.get() != NULL;
606 } 613 }
607 614
608 Profile* TestingProfile::GetOriginalProfile() { 615 Profile* TestingProfile::GetOriginalProfile() {
609 if (original_profile_) 616 if (original_profile_)
610 return original_profile_; 617 return original_profile_;
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
946 path_, 953 path_,
947 delegate_, 954 delegate_,
948 extension_policy_, 955 extension_policy_,
949 pref_service_.Pass(), 956 pref_service_.Pass(),
950 incognito_, 957 incognito_,
951 guest_session_, 958 guest_session_,
952 managed_user_id_, 959 managed_user_id_,
953 policy_service_.Pass(), 960 policy_service_.Pass(),
954 testing_factories_)); 961 testing_factories_));
955 } 962 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698