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/browser/printing/print_dialog_cloud.h" | 5 #include "chrome/browser/printing/print_dialog_cloud.h" |
6 #include "chrome/browser/printing/print_dialog_cloud_internal.h" | 6 #include "chrome/browser/printing/print_dialog_cloud_internal.h" |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 base::FilePath test_data_file_name = GetTestDataFileName(); | 263 base::FilePath test_data_file_name = GetTestDataFileName(); |
264 BrowserThread::PostTask( | 264 BrowserThread::PostTask( |
265 BrowserThread::IO, FROM_HERE, | 265 BrowserThread::IO, FROM_HERE, |
266 base::Bind(&CloudPrintDataSender::SendPrintData, print_data_sender)); | 266 base::Bind(&CloudPrintDataSender::SendPrintData, print_data_sender)); |
267 MessageLoop::current()->RunUntilIdle(); | 267 MessageLoop::current()->RunUntilIdle(); |
268 } | 268 } |
269 | 269 |
270 TEST_F(CloudPrintDataSenderTest, EmptyData) { | 270 TEST_F(CloudPrintDataSenderTest, EmptyData) { |
271 EXPECT_CALL(*mock_helper_, CallJavascriptFunction(_, _, _)).Times(0); | 271 EXPECT_CALL(*mock_helper_, CallJavascriptFunction(_, _, _)).Times(0); |
272 | 272 |
273 std::string data(""); | 273 std::string data; |
274 scoped_refptr<CloudPrintDataSender> print_data_sender( | 274 scoped_refptr<CloudPrintDataSender> print_data_sender( |
275 CreateSender(base::RefCountedString::TakeString(&data))); | 275 CreateSender(base::RefCountedString::TakeString(&data))); |
276 base::FilePath test_data_file_name = GetTestDataFileName(); | 276 base::FilePath test_data_file_name = GetTestDataFileName(); |
277 BrowserThread::PostTask( | 277 BrowserThread::PostTask( |
278 BrowserThread::IO, FROM_HERE, | 278 BrowserThread::IO, FROM_HERE, |
279 base::Bind(&CloudPrintDataSender::SendPrintData, print_data_sender)); | 279 base::Bind(&CloudPrintDataSender::SendPrintData, print_data_sender)); |
280 MessageLoop::current()->RunUntilIdle(); | 280 MessageLoop::current()->RunUntilIdle(); |
281 } | 281 } |
282 | 282 |
283 // Testing for CloudPrintFlowHandler needs a mock | 283 // Testing for CloudPrintFlowHandler needs a mock |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 std::vector<WebUIMessageHandler*> handlers; | 341 std::vector<WebUIMessageHandler*> handlers; |
342 delegate_->GetWebUIMessageHandlers(&handlers); | 342 delegate_->GetWebUIMessageHandlers(&handlers); |
343 delegate_.reset(); | 343 delegate_.reset(); |
344 EXPECT_THAT(mock_flow_handler_.get(), NotNull()); | 344 EXPECT_THAT(mock_flow_handler_.get(), NotNull()); |
345 } | 345 } |
346 | 346 |
347 // Testing for ExternalWebDialogUI needs a mock WebContents and mock | 347 // Testing for ExternalWebDialogUI needs a mock WebContents and mock |
348 // CloudPrintWebDialogDelegate (attached to the mock web_contents). | 348 // CloudPrintWebDialogDelegate (attached to the mock web_contents). |
349 | 349 |
350 // Testing for PrintDialogCloud needs a mock Browser. | 350 // Testing for PrintDialogCloud needs a mock Browser. |
OLD | NEW |