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