| 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/files/file_enumerator.h" | 6 #include "base/files/file_enumerator.h" |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 } | 73 } |
| 74 | 74 |
| 75 virtual void Observe(int type, | 75 virtual void Observe(int type, |
| 76 const content::NotificationSource& source, | 76 const content::NotificationSource& source, |
| 77 const content::NotificationDetails& details) { | 77 const content::NotificationDetails& details) { |
| 78 ASSERT_EQ(chrome::NOTIFICATION_PRINT_JOB_EVENT, type); | 78 ASSERT_EQ(chrome::NOTIFICATION_PRINT_JOB_EVENT, type); |
| 79 switch (content::Details<printing::JobEventDetails>(details)->type()) { | 79 switch (content::Details<printing::JobEventDetails>(details)->type()) { |
| 80 case printing::JobEventDetails::JOB_DONE: { | 80 case printing::JobEventDetails::JOB_DONE: { |
| 81 // Succeeded. | 81 // Succeeded. |
| 82 base::MessageLoop::current()->PostTask( | 82 base::MessageLoop::current()->PostTask( |
| 83 FROM_HERE, base::MessageLoop::QuitClosure()); | 83 FROM_HERE, base::MessageLoop::QuitWhenIdleClosure()); |
| 84 break; | 84 break; |
| 85 } | 85 } |
| 86 case printing::JobEventDetails::USER_INIT_CANCELED: | 86 case printing::JobEventDetails::USER_INIT_CANCELED: |
| 87 case printing::JobEventDetails::FAILED: { | 87 case printing::JobEventDetails::FAILED: { |
| 88 // Failed. | 88 // Failed. |
| 89 ASSERT_TRUE(false); | 89 ASSERT_TRUE(false); |
| 90 base::MessageLoop::current()->PostTask( | 90 base::MessageLoop::current()->PostTask( |
| 91 FROM_HERE, base::MessageLoop::QuitClosure()); | 91 FROM_HERE, base::MessageLoop::QuitWhenIdleClosure()); |
| 92 break; | 92 break; |
| 93 } | 93 } |
| 94 case printing::JobEventDetails::NEW_DOC: | 94 case printing::JobEventDetails::NEW_DOC: |
| 95 case printing::JobEventDetails::USER_INIT_DONE: | 95 case printing::JobEventDetails::USER_INIT_DONE: |
| 96 case printing::JobEventDetails::DEFAULT_INIT_DONE: | 96 case printing::JobEventDetails::DEFAULT_INIT_DONE: |
| 97 case printing::JobEventDetails::NEW_PAGE: | 97 case printing::JobEventDetails::NEW_PAGE: |
| 98 case printing::JobEventDetails::PAGE_DONE: | 98 case printing::JobEventDetails::PAGE_DONE: |
| 99 case printing::JobEventDetails::DOC_DONE: | 99 case printing::JobEventDetails::DOC_DONE: |
| 100 case printing::JobEventDetails::ALL_PAGES_REQUESTED: { | 100 case printing::JobEventDetails::ALL_PAGES_REQUESTED: { |
| 101 // Don't care. | 101 // Don't care. |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 | 460 |
| 461 // Force a navigation elsewhere to verify that it's fine with it. | 461 // Force a navigation elsewhere to verify that it's fine with it. |
| 462 url = test_server()->GetURL("files/printing/test1.html"); | 462 url = test_server()->GetURL("files/printing/test1.html"); |
| 463 ui_test_utils::NavigateToURL(browser(), url); | 463 ui_test_utils::NavigateToURL(browser(), url); |
| 464 } | 464 } |
| 465 chrome::CloseWindow(browser()); | 465 chrome::CloseWindow(browser()); |
| 466 content::RunAllPendingInMessageLoop(); | 466 content::RunAllPendingInMessageLoop(); |
| 467 | 467 |
| 468 EXPECT_EQ(0., CompareWithResult(L"iframe")) << L"iframe"; | 468 EXPECT_EQ(0., CompareWithResult(L"iframe")) << L"iframe"; |
| 469 } | 469 } |
| OLD | NEW |