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 "chrome/service/cloud_print/cloud_print_helpers.h" | 5 #include "chrome/service/cloud_print/cloud_print_helpers.h" |
6 | 6 |
7 #include "base/md5.h" | 7 #include "base/md5.h" |
8 #include "base/stringprintf.h" | 8 #include "base/stringprintf.h" |
9 #include "base/sys_info.h" | 9 #include "base/sys_info.h" |
10 #include "chrome/common/chrome_version_info.h" | 10 #include "chrome/common/chrome_version_info.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 CheckJobStatusURLs(GURL("http://www.myprinterserver.com")); | 46 CheckJobStatusURLs(GURL("http://www.myprinterserver.com")); |
47 CheckJobStatusURLs(GURL("http://www.myprinterserver.com/")); | 47 CheckJobStatusURLs(GURL("http://www.myprinterserver.com/")); |
48 } | 48 } |
49 | 49 |
50 TEST(CloudPrintServiceHelpersTest, GetHashOfPrinterInfo) { | 50 TEST(CloudPrintServiceHelpersTest, GetHashOfPrinterInfo) { |
51 printing::PrinterBasicInfo printer_info; | 51 printing::PrinterBasicInfo printer_info; |
52 printer_info.options["tag1"] = std::string("value1"); | 52 printer_info.options["tag1"] = std::string("value1"); |
53 printer_info.options["tag2"] = std::string("value2"); | 53 printer_info.options["tag2"] = std::string("value2"); |
54 | 54 |
55 chrome::VersionInfo version_info; | 55 chrome::VersionInfo version_info; |
56 std::string expected_list_string = StringPrintf( | 56 std::string expected_list_string = base::StringPrintf( |
57 "chrome_version%ssystem_name%ssystem_version%stag1value1tag2value2", | 57 "chrome_version%ssystem_name%ssystem_version%stag1value1tag2value2", |
58 version_info.CreateVersionString().c_str(), | 58 version_info.CreateVersionString().c_str(), |
59 base::SysInfo::OperatingSystemName().c_str(), | 59 base::SysInfo::OperatingSystemName().c_str(), |
60 base::SysInfo::OperatingSystemVersion().c_str()); | 60 base::SysInfo::OperatingSystemVersion().c_str()); |
61 EXPECT_EQ(base::MD5String(expected_list_string), | 61 EXPECT_EQ(base::MD5String(expected_list_string), |
62 GetHashOfPrinterInfo(printer_info)); | 62 GetHashOfPrinterInfo(printer_info)); |
63 } | 63 } |
64 | 64 |
65 TEST(CloudPrintServiceHelpersTest, GetPostDataForPrinterInfo) { | 65 TEST(CloudPrintServiceHelpersTest, GetPostDataForPrinterInfo) { |
66 printing::PrinterBasicInfo printer_info; | 66 printing::PrinterBasicInfo printer_info; |
(...skipping 28 matching lines...) Expand all Loading... |
95 tags_not_dry_run.push_back("tag_1"); | 95 tags_not_dry_run.push_back("tag_1"); |
96 EXPECT_FALSE(IsDryRunJob(tags_not_dry_run)); | 96 EXPECT_FALSE(IsDryRunJob(tags_not_dry_run)); |
97 | 97 |
98 std::vector<std::string> tags_dry_run; | 98 std::vector<std::string> tags_dry_run; |
99 tags_dry_run.push_back("__cp__dry_run"); | 99 tags_dry_run.push_back("__cp__dry_run"); |
100 EXPECT_TRUE(IsDryRunJob(tags_dry_run)); | 100 EXPECT_TRUE(IsDryRunJob(tags_dry_run)); |
101 } | 101 } |
102 | 102 |
103 } // namespace cloud_print | 103 } // namespace cloud_print |
104 | 104 |
OLD | NEW |