Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(46)

Side by Side Diff: chrome/browser/printing/printing_layout_browsertest.cc

Issue 1395103003: Don't use base::MessageLoop::{Quit,QuitClosure} in chrome/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/printing/print_view_manager_base.cc ('k') | chrome/browser/profiles/profile_list_desktop_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698