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

Side by Side Diff: chrome/browser/chromeos/cros/onc_network_parser_unittest.cc

Issue 11759019: Update other unittests to use newly added TestingBrowserProcess::GetGlobal(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: simpler codez Created 7 years, 11 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
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/browser/chromeos/cros/onc_network_parser.h" 5 #include "chrome/browser/chromeos/cros/onc_network_parser.h"
6 6
7 #include <cert.h> 7 #include <cert.h>
8 #include <keyhi.h> 8 #include <keyhi.h>
9 #include <pk11pub.h> 9 #include <pk11pub.h>
10 10
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 EXPECT_CALL(*mock_user_manager.user_manager(), IsUserLoggedIn()) 545 EXPECT_CALL(*mock_user_manager.user_manager(), IsUserLoggedIn())
546 .Times(2) 546 .Times(2)
547 .WillRepeatedly(Return(false)); 547 .WillRepeatedly(Return(false));
548 548
549 onc::ONCSource source = onc::ONC_SOURCE_USER_IMPORT; 549 onc::ONCSource source = onc::ONC_SOURCE_USER_IMPORT;
550 550
551 // Setup environment needed by UserManager. 551 // Setup environment needed by UserManager.
552 MessageLoop loop; 552 MessageLoop loop;
553 content::TestBrowserThread ui_thread(content::BrowserThread::UI, &loop); 553 content::TestBrowserThread ui_thread(content::BrowserThread::UI, &loop);
554 base::ShadowingAtExitManager at_exit_manager; 554 base::ShadowingAtExitManager at_exit_manager;
555 ScopedTestingLocalState local_state( 555 ScopedTestingLocalState local_state(TestingBrowserProcess::GetGlobal());
556 static_cast<TestingBrowserProcess*>(g_browser_process));
557 556
558 base::StringValue login_id_pattern("a ${LOGIN_ID} b"); 557 base::StringValue login_id_pattern("a ${LOGIN_ID} b");
559 base::StringValue login_email_pattern("a ${LOGIN_EMAIL} b"); 558 base::StringValue login_email_pattern("a ${LOGIN_EMAIL} b");
560 559
561 // No expansion if there is no user logged in. 560 // No expansion if there is no user logged in.
562 EXPECT_EQ("a ${LOGIN_ID} b", 561 EXPECT_EQ("a ${LOGIN_ID} b",
563 chromeos::OncNetworkParser::GetUserExpandedValue( 562 chromeos::OncNetworkParser::GetUserExpandedValue(
564 login_id_pattern, source)); 563 login_id_pattern, source));
565 EXPECT_EQ("a ${LOGIN_EMAIL} b", 564 EXPECT_EQ("a ${LOGIN_EMAIL} b",
566 chromeos::OncNetworkParser::GetUserExpandedValue( 565 chromeos::OncNetworkParser::GetUserExpandedValue(
(...skipping 19 matching lines...) Expand all
586 onc::ONC_SOURCE_USER_IMPORT); 585 onc::ONC_SOURCE_USER_IMPORT);
587 EXPECT_EQ(1, parser.GetNetworkConfigsSize()); 586 EXPECT_EQ(1, parser.GetNetworkConfigsSize());
588 bool marked_for_removal = false; 587 bool marked_for_removal = false;
589 scoped_ptr<Network> network(parser.ParseNetwork(0, &marked_for_removal)); 588 scoped_ptr<Network> network(parser.ParseNetwork(0, &marked_for_removal));
590 589
591 EXPECT_TRUE(marked_for_removal); 590 EXPECT_TRUE(marked_for_removal);
592 EXPECT_EQ("{485d6076-dd44-6b6d-69787465725f5045}", network->unique_id()); 591 EXPECT_EQ("{485d6076-dd44-6b6d-69787465725f5045}", network->unique_id());
593 } 592 }
594 593
595 } // namespace chromeos 594 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698