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

Side by Side Diff: chrome/browser/ui/startup/startup_browser_creator_browsertest.cc

Issue 388963002: Get rid of the rest of CreateStringValue (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tweaks Created 6 years, 5 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 <algorithm> 5 #include <algorithm>
6 #include <string> 6 #include <string>
7 7
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 1391 matching lines...) Expand 10 before | Expand all | Expand 10 after
1402 1402
1403 // Set the following user policies: 1403 // Set the following user policies:
1404 // * RestoreOnStartup = RestoreOnStartupIsURLs 1404 // * RestoreOnStartup = RestoreOnStartupIsURLs
1405 // * RestoreOnStartupURLs = [ "files/title1.html" ] 1405 // * RestoreOnStartupURLs = [ "files/title1.html" ]
1406 policy_map_.Set(policy::key::kRestoreOnStartup, 1406 policy_map_.Set(policy::key::kRestoreOnStartup,
1407 policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, 1407 policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER,
1408 base::Value::CreateIntegerValue( 1408 base::Value::CreateIntegerValue(
1409 SessionStartupPref::kPrefValueURLs), 1409 SessionStartupPref::kPrefValueURLs),
1410 NULL); 1410 NULL);
1411 base::ListValue startup_urls; 1411 base::ListValue startup_urls;
1412 startup_urls.Append(base::Value::CreateStringValue( 1412 startup_urls.Append(
1413 test_server()->GetURL("files/title1.html").spec())); 1413 new base::StringValue(test_server()->GetURL("files/title1.html").spec()));
1414 policy_map_.Set(policy::key::kRestoreOnStartupURLs, 1414 policy_map_.Set(policy::key::kRestoreOnStartupURLs,
1415 policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, 1415 policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER,
1416 startup_urls.DeepCopy(), NULL); 1416 startup_urls.DeepCopy(), NULL);
1417 provider_.UpdateChromePolicy(policy_map_); 1417 provider_.UpdateChromePolicy(policy_map_);
1418 base::RunLoop().RunUntilIdle(); 1418 base::RunLoop().RunUntilIdle();
1419 1419
1420 // Do a process-startup browser launch. 1420 // Do a process-startup browser launch.
1421 CommandLine dummy(CommandLine::NO_PROGRAM); 1421 CommandLine dummy(CommandLine::NO_PROGRAM);
1422 StartupBrowserCreatorImpl launch(base::FilePath(), dummy, &browser_creator, 1422 StartupBrowserCreatorImpl launch(base::FilePath(), dummy, &browser_creator,
1423 chrome::startup::IS_FIRST_RUN); 1423 chrome::startup::IS_FIRST_RUN);
(...skipping 10 matching lines...) Expand all
1434 ASSERT_EQ(1, tab_strip->count()); 1434 ASSERT_EQ(1, tab_strip->count());
1435 EXPECT_EQ("title1.html", 1435 EXPECT_EQ("title1.html",
1436 tab_strip->GetWebContentsAt(0)->GetURL().ExtractFileName()); 1436 tab_strip->GetWebContentsAt(0)->GetURL().ExtractFileName());
1437 } 1437 }
1438 #endif // defined(ENABLE_CONFIGURATION_POLICY) 1438 #endif // defined(ENABLE_CONFIGURATION_POLICY)
1439 1439
1440 #endif // !defined(OS_LINUX) || !defined(GOOGLE_CHROME_BUILD) || 1440 #endif // !defined(OS_LINUX) || !defined(GOOGLE_CHROME_BUILD) ||
1441 // defined(ENABLE_CONFIGURATION_POLICY) 1441 // defined(ENABLE_CONFIGURATION_POLICY)
1442 1442
1443 #endif // !defined(OS_CHROMEOS) 1443 #endif // !defined(OS_CHROMEOS)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698