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

Side by Side Diff: chrome/browser/extensions/extension_browsertest.cc

Issue 10479018: Add base::RunLoop and update ui_test_utils to use it to reduce flakiness (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: win_shared build Created 8 years, 6 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 | Annotate | Revision Log
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 "chrome/browser/extensions/extension_browsertest.h" 5 #include "chrome/browser/extensions/extension_browsertest.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 CHECK(service->AllowFileAccess(extension)); 132 CHECK(service->AllowFileAccess(extension));
133 133
134 if (!fileaccess_enabled) { 134 if (!fileaccess_enabled) {
135 service->SetAllowFileAccess(extension, fileaccess_enabled); 135 service->SetAllowFileAccess(extension, fileaccess_enabled);
136 load_signal.Wait(); 136 load_signal.Wait();
137 extension = service->GetExtensionById(extension_id, false); 137 extension = service->GetExtensionById(extension_id, false);
138 CHECK(extension) << extension_id << " not found after reloading."; 138 CHECK(extension) << extension_id << " not found after reloading.";
139 } 139 }
140 } 140 }
141 141
142 // After chrome::NOTIFICATION_EXTENSION_LOADED there are still remaining tasks
Paweł Hajdan Jr. 2012/06/18 15:56:25 Have you checked all tests where we wait for NOTIF
jbates 2012/06/18 23:14:03 Removed to see if reposting Quit task is enough.
143 // that need to complete for extensions to be in a settled load state.
144 ui_test_utils::RunAllPendingInMessageLoop();
145
142 if (!WaitForExtensionViewsToLoad()) 146 if (!WaitForExtensionViewsToLoad())
143 return NULL; 147 return NULL;
144 148
145 return extension; 149 return extension;
146 } 150 }
147 151
148 const Extension* ExtensionBrowserTest::LoadExtension(const FilePath& path) { 152 const Extension* ExtensionBrowserTest::LoadExtension(const FilePath& path) {
149 return LoadExtensionWithOptions(path, false, true); 153 return LoadExtensionWithOptions(path, false, true);
150 } 154 }
151 155
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 case content::NOTIFICATION_LOAD_STOP: 603 case content::NOTIFICATION_LOAD_STOP:
600 VLOG(1) << "Got LOAD_STOP notification."; 604 VLOG(1) << "Got LOAD_STOP notification.";
601 MessageLoopForUI::current()->Quit(); 605 MessageLoopForUI::current()->Quit();
602 break; 606 break;
603 607
604 default: 608 default:
605 NOTREACHED(); 609 NOTREACHED();
606 break; 610 break;
607 } 611 }
608 } 612 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698