OLD | NEW |
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 1393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1404 | 1404 |
1405 // Set the following user policies: | 1405 // Set the following user policies: |
1406 // * RestoreOnStartup = RestoreOnStartupIsURLs | 1406 // * RestoreOnStartup = RestoreOnStartupIsURLs |
1407 // * RestoreOnStartupURLs = [ "files/title1.html" ] | 1407 // * RestoreOnStartupURLs = [ "files/title1.html" ] |
1408 policy_map_.Set(policy::key::kRestoreOnStartup, | 1408 policy_map_.Set(policy::key::kRestoreOnStartup, |
1409 policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, | 1409 policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, |
1410 base::Value::CreateIntegerValue( | 1410 base::Value::CreateIntegerValue( |
1411 SessionStartupPref::kPrefValueURLs), | 1411 SessionStartupPref::kPrefValueURLs), |
1412 NULL); | 1412 NULL); |
1413 base::ListValue startup_urls; | 1413 base::ListValue startup_urls; |
1414 startup_urls.Append(base::Value::CreateStringValue( | 1414 startup_urls.Append( |
1415 test_server()->GetURL("files/title1.html").spec())); | 1415 new base::StringValue(test_server()->GetURL("files/title1.html").spec())); |
1416 policy_map_.Set(policy::key::kRestoreOnStartupURLs, | 1416 policy_map_.Set(policy::key::kRestoreOnStartupURLs, |
1417 policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, | 1417 policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, |
1418 startup_urls.DeepCopy(), NULL); | 1418 startup_urls.DeepCopy(), NULL); |
1419 provider_.UpdateChromePolicy(policy_map_); | 1419 provider_.UpdateChromePolicy(policy_map_); |
1420 base::RunLoop().RunUntilIdle(); | 1420 base::RunLoop().RunUntilIdle(); |
1421 | 1421 |
1422 // Do a process-startup browser launch. | 1422 // Do a process-startup browser launch. |
1423 CommandLine dummy(CommandLine::NO_PROGRAM); | 1423 CommandLine dummy(CommandLine::NO_PROGRAM); |
1424 StartupBrowserCreatorImpl launch(base::FilePath(), dummy, &browser_creator, | 1424 StartupBrowserCreatorImpl launch(base::FilePath(), dummy, &browser_creator, |
1425 chrome::startup::IS_FIRST_RUN); | 1425 chrome::startup::IS_FIRST_RUN); |
(...skipping 10 matching lines...) Expand all Loading... |
1436 ASSERT_EQ(1, tab_strip->count()); | 1436 ASSERT_EQ(1, tab_strip->count()); |
1437 EXPECT_EQ("title1.html", | 1437 EXPECT_EQ("title1.html", |
1438 tab_strip->GetWebContentsAt(0)->GetURL().ExtractFileName()); | 1438 tab_strip->GetWebContentsAt(0)->GetURL().ExtractFileName()); |
1439 } | 1439 } |
1440 #endif // defined(ENABLE_CONFIGURATION_POLICY) | 1440 #endif // defined(ENABLE_CONFIGURATION_POLICY) |
1441 | 1441 |
1442 #endif // !defined(OS_LINUX) || !defined(GOOGLE_CHROME_BUILD) || | 1442 #endif // !defined(OS_LINUX) || !defined(GOOGLE_CHROME_BUILD) || |
1443 // defined(ENABLE_CONFIGURATION_POLICY) | 1443 // defined(ENABLE_CONFIGURATION_POLICY) |
1444 | 1444 |
1445 #endif // !defined(OS_CHROMEOS) | 1445 #endif // !defined(OS_CHROMEOS) |
OLD | NEW |