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

Side by Side Diff: chrome/test/remoting/remote_desktop_browsertest.cc

Issue 1310173010: Remove use of JSONReader::DeprecatedRead from chrome/test (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Created 5 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/test/chromedriver/performance_logger_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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/remoting/remote_desktop_browsertest.h" 5 #include "chrome/test/remoting/remote_desktop_browsertest.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/json/json_reader.h" 9 #include "base/json/json_reader.h"
10 #include "base/macros.h"
10 #include "base/path_service.h" 11 #include "base/path_service.h"
11 #include "chrome/browser/extensions/extension_service.h" 12 #include "chrome/browser/extensions/extension_service.h"
12 #include "chrome/browser/extensions/unpacked_installer.h" 13 #include "chrome/browser/extensions/unpacked_installer.h"
13 #include "chrome/browser/ui/extensions/app_launch_params.h" 14 #include "chrome/browser/ui/extensions/app_launch_params.h"
14 #include "chrome/browser/ui/extensions/application_launch.h" 15 #include "chrome/browser/ui/extensions/application_launch.h"
15 #include "chrome/browser/ui/webui/signin/login_ui_test_utils.h" 16 #include "chrome/browser/ui/webui/signin/login_ui_test_utils.h"
16 #include "chrome/common/chrome_switches.h" 17 #include "chrome/common/chrome_switches.h"
17 #include "chrome/test/remoting/key_code_conv.h" 18 #include "chrome/test/remoting/key_code_conv.h"
18 #include "chrome/test/remoting/page_load_notification_observer.h" 19 #include "chrome/test/remoting/page_load_notification_observer.h"
19 #include "chrome/test/remoting/waiter.h" 20 #include "chrome/test/remoting/waiter.h"
(...skipping 823 matching lines...) Expand 10 before | Expand all | Expand 10 after
843 DismissHostVersionWarningIfVisible(); 844 DismissHostVersionWarningIfVisible();
844 return HtmlElementVisible("pin-form"); 845 return HtmlElementVisible("pin-form");
845 } 846 }
846 847
847 void RemoteDesktopBrowserTest::DismissHostVersionWarningIfVisible() { 848 void RemoteDesktopBrowserTest::DismissHostVersionWarningIfVisible() {
848 if (HtmlElementVisible("host-needs-update-connect-button")) 849 if (HtmlElementVisible("host-needs-update-connect-button"))
849 ClickOnControl("host-needs-update-connect-button"); 850 ClickOnControl("host-needs-update-connect-button");
850 } 851 }
851 852
852 void RemoteDesktopBrowserTest::SetUserNameAndPassword( 853 void RemoteDesktopBrowserTest::SetUserNameAndPassword(
853 const base::FilePath &accounts_file_path, const std::string& account_type) { 854 const base::FilePath& accounts_file_path,
854 855 const std::string& account_type) {
855 // Read contents of accounts file, using its absolute path. 856 // Read contents of accounts file, using its absolute path.
856 base::FilePath absolute_path = base::MakeAbsoluteFilePath(accounts_file_path); 857 base::FilePath absolute_path = base::MakeAbsoluteFilePath(accounts_file_path);
857 std::string accounts_info; 858 std::string accounts_info;
858 ASSERT_TRUE(base::ReadFileToString(absolute_path, &accounts_info)); 859 ASSERT_TRUE(base::ReadFileToString(absolute_path, &accounts_info));
859 860
860 // Get the root dictionary from the input json file contents. 861 // Get the root dictionary from the input json file contents.
861 scoped_ptr<base::Value> root(base::JSONReader::DeprecatedRead( 862 scoped_ptr<base::Value> root =
862 accounts_info, base::JSON_ALLOW_TRAILING_COMMAS)); 863 base::JSONReader::Read(accounts_info, base::JSON_ALLOW_TRAILING_COMMAS);
863 864
864 const base::DictionaryValue* root_dict = NULL; 865 const base::DictionaryValue* root_dict = NULL;
865 ASSERT_TRUE(root.get() && root->GetAsDictionary(&root_dict)); 866 ASSERT_TRUE(root.get() && root->GetAsDictionary(&root_dict));
866 867
867 // Now get the dictionary for the specified account type. 868 // Now get the dictionary for the specified account type.
868 const base::DictionaryValue* account_dict = NULL; 869 const base::DictionaryValue* account_dict = NULL;
869 ASSERT_TRUE(root_dict->GetDictionary(account_type, &account_dict)); 870 ASSERT_TRUE(root_dict->GetDictionary(account_type, &account_dict));
870 ASSERT_TRUE(account_dict->GetString(kUserName, &username_)); 871 ASSERT_TRUE(account_dict->GetString(kUserName, &username_));
871 ASSERT_TRUE(account_dict->GetString(kUserPassword, &password_)); 872 ASSERT_TRUE(account_dict->GetString(kUserPassword, &password_));
872 } 873 }
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
921 922
922 ConditionalTimeoutWaiter homeWaiter( 923 ConditionalTimeoutWaiter homeWaiter(
923 base::TimeDelta::FromSeconds(5), 924 base::TimeDelta::FromSeconds(5),
924 base::TimeDelta::FromMilliseconds(500), 925 base::TimeDelta::FromMilliseconds(500),
925 base::Bind(&RemoteDesktopBrowserTest::IsAppModeEqualTo, 926 base::Bind(&RemoteDesktopBrowserTest::IsAppModeEqualTo,
926 this, "remoting.AppMode.HOME")); 927 this, "remoting.AppMode.HOME"));
927 EXPECT_TRUE(homeWaiter.Wait()); 928 EXPECT_TRUE(homeWaiter.Wait());
928 } 929 }
929 930
930 } // namespace remoting 931 } // namespace remoting
OLDNEW
« no previous file with comments | « chrome/test/chromedriver/performance_logger_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698