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

Side by Side Diff: chrome/browser/extensions/extensions_service_unittest.cc

Issue 329017: Remove deprecated CommandLine(std::wstring) ctor. (Closed)
Patch Set: Created 11 years, 2 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
« no previous file with comments | « chrome/browser/browser_init_browsertest.cc ('k') | chrome/browser/first_run_win.cc » ('j') | 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) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 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 <algorithm> 5 #include <algorithm>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
(...skipping 1515 matching lines...) Expand 10 before | Expand all | Expand 10 after
1526 TEST(ExtensionsServiceTestSimple, Enabledness) { 1526 TEST(ExtensionsServiceTestSimple, Enabledness) {
1527 ExtensionsReadyRecorder recorder; 1527 ExtensionsReadyRecorder recorder;
1528 TestingProfile profile; 1528 TestingProfile profile;
1529 MessageLoop loop; 1529 MessageLoop loop;
1530 scoped_ptr<CommandLine> command_line; 1530 scoped_ptr<CommandLine> command_line;
1531 scoped_refptr<ExtensionsService> service; 1531 scoped_refptr<ExtensionsService> service;
1532 FilePath install_dir = profile.GetPath() 1532 FilePath install_dir = profile.GetPath()
1533 .AppendASCII(ExtensionsService::kInstallDirectoryName); 1533 .AppendASCII(ExtensionsService::kInstallDirectoryName);
1534 1534
1535 // By default, we are enabled. 1535 // By default, we are enabled.
1536 command_line.reset(new CommandLine(L"")); 1536 command_line.reset(new CommandLine(CommandLine::ARGUMENTS_ONLY));
1537 service = new ExtensionsService(&profile, command_line.get(), 1537 service = new ExtensionsService(&profile, command_line.get(),
1538 profile.GetPrefs(), install_dir, &loop, &loop, false); 1538 profile.GetPrefs(), install_dir, &loop, &loop, false);
1539 EXPECT_TRUE(service->extensions_enabled()); 1539 EXPECT_TRUE(service->extensions_enabled());
1540 service->Init(); 1540 service->Init();
1541 loop.RunAllPending(); 1541 loop.RunAllPending();
1542 EXPECT_TRUE(recorder.ready()); 1542 EXPECT_TRUE(recorder.ready());
1543 1543
1544 // If either the command line or pref is set, we are disabled. 1544 // If either the command line or pref is set, we are disabled.
1545 recorder.set_ready(false); 1545 recorder.set_ready(false);
1546 command_line->AppendSwitch(switches::kDisableExtensions); 1546 command_line->AppendSwitch(switches::kDisableExtensions);
1547 service = new ExtensionsService(&profile, command_line.get(), 1547 service = new ExtensionsService(&profile, command_line.get(),
1548 profile.GetPrefs(), install_dir, &loop, &loop, false); 1548 profile.GetPrefs(), install_dir, &loop, &loop, false);
1549 EXPECT_FALSE(service->extensions_enabled()); 1549 EXPECT_FALSE(service->extensions_enabled());
1550 service->Init(); 1550 service->Init();
1551 loop.RunAllPending(); 1551 loop.RunAllPending();
1552 EXPECT_TRUE(recorder.ready()); 1552 EXPECT_TRUE(recorder.ready());
1553 1553
1554 recorder.set_ready(false); 1554 recorder.set_ready(false);
1555 profile.GetPrefs()->SetBoolean(prefs::kDisableExtensions, true); 1555 profile.GetPrefs()->SetBoolean(prefs::kDisableExtensions, true);
1556 service = new ExtensionsService(&profile, command_line.get(), 1556 service = new ExtensionsService(&profile, command_line.get(),
1557 profile.GetPrefs(), install_dir, &loop, &loop, false); 1557 profile.GetPrefs(), install_dir, &loop, &loop, false);
1558 EXPECT_FALSE(service->extensions_enabled()); 1558 EXPECT_FALSE(service->extensions_enabled());
1559 service->Init(); 1559 service->Init();
1560 loop.RunAllPending(); 1560 loop.RunAllPending();
1561 EXPECT_TRUE(recorder.ready()); 1561 EXPECT_TRUE(recorder.ready());
1562 1562
1563 recorder.set_ready(false); 1563 recorder.set_ready(false);
1564 command_line.reset(new CommandLine(L"")); 1564 command_line.reset(new CommandLine(CommandLine::ARGUMENTS_ONLY));
1565 service = new ExtensionsService(&profile, command_line.get(), 1565 service = new ExtensionsService(&profile, command_line.get(),
1566 profile.GetPrefs(), install_dir, &loop, &loop, false); 1566 profile.GetPrefs(), install_dir, &loop, &loop, false);
1567 EXPECT_FALSE(service->extensions_enabled()); 1567 EXPECT_FALSE(service->extensions_enabled());
1568 service->Init(); 1568 service->Init();
1569 loop.RunAllPending(); 1569 loop.RunAllPending();
1570 EXPECT_TRUE(recorder.ready()); 1570 EXPECT_TRUE(recorder.ready());
1571 } 1571 }
OLDNEW
« no previous file with comments | « chrome/browser/browser_init_browsertest.cc ('k') | chrome/browser/first_run_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698