OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/service/cloud_print/printer_job_queue_handler.h" | 5 #include "chrome/service/cloud_print/printer_job_queue_handler.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 | 74 |
75 EXPECT_EQ(std::string("__testjob1"), jobs[0].job_id_); | 75 EXPECT_EQ(std::string("__testjob1"), jobs[0].job_id_); |
76 EXPECT_EQ(std::string("test1"), jobs[0].job_title_); | 76 EXPECT_EQ(std::string("test1"), jobs[0].job_title_); |
77 EXPECT_EQ(std::string("http://example.com/job1ticket"), | 77 EXPECT_EQ(std::string("http://example.com/job1ticket"), |
78 jobs[0].print_ticket_url_); | 78 jobs[0].print_ticket_url_); |
79 EXPECT_EQ(std::string("http://example.com/job1data"), | 79 EXPECT_EQ(std::string("http://example.com/job1data"), |
80 jobs[0].print_data_url_); | 80 jobs[0].print_data_url_); |
81 | 81 |
82 std::set<std::string> expected_tags; | 82 std::set<std::string> expected_tags; |
83 expected_tags.insert("^own"); | 83 expected_tags.insert("^own"); |
84 expected_tags.insert(""); | 84 expected_tags.insert(std::string()); |
85 std::set<std::string> actual_tags; | 85 std::set<std::string> actual_tags; |
86 actual_tags.insert(jobs[0].tags_.begin(), jobs[0].tags_.end()); | 86 actual_tags.insert(jobs[0].tags_.begin(), jobs[0].tags_.end()); |
87 | 87 |
88 EXPECT_EQ(expected_tags, actual_tags); | 88 EXPECT_EQ(expected_tags, actual_tags); |
89 EXPECT_EQ(base::TimeDelta(), jobs[0].time_remaining_); | 89 EXPECT_EQ(base::TimeDelta(), jobs[0].time_remaining_); |
90 } | 90 } |
91 | 91 |
92 TEST_F(PrinterJobQueueHandlerTest, PreferNonFailureTest) { | 92 TEST_F(PrinterJobQueueHandlerTest, PreferNonFailureTest) { |
93 TimeProviderMock* time_mock = new TimeProviderMock(); | 93 TimeProviderMock* time_mock = new TimeProviderMock(); |
94 PrinterJobQueueHandler job_queue_handler(time_mock); | 94 PrinterJobQueueHandler job_queue_handler(time_mock); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 base::TimeDelta::FromSeconds(4) + time_to_wait)); | 172 base::TimeDelta::FromSeconds(4) + time_to_wait)); |
173 | 173 |
174 job_queue_handler.GetJobsFromQueue(json_data_, | 174 job_queue_handler.GetJobsFromQueue(json_data_, |
175 &jobs); | 175 &jobs); |
176 | 176 |
177 EXPECT_EQ(base::TimeDelta(), jobs[0].time_remaining_); | 177 EXPECT_EQ(base::TimeDelta(), jobs[0].time_remaining_); |
178 EXPECT_EQ(std::string("__testjob2"), jobs[0].job_id_); | 178 EXPECT_EQ(std::string("__testjob2"), jobs[0].job_id_); |
179 } | 179 } |
180 | 180 |
181 } // namespace cloud_print | 181 } // namespace cloud_print |
OLD | NEW |