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

Side by Side Diff: extensions/browser/preload_check_test_util.cc

Issue 2693373003: PreloadCheck class for extension pre-install checks (Closed)
Patch Set: rebase Created 3 years, 9 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
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "extensions/browser/preload_check_test_util.h"
6
7 #include "base/logging.h"
8 #include "base/run_loop.h"
9
10 namespace extensions {
11
12 PreloadCheckObserver::PreloadCheckObserver() : called_(false) {}
13 PreloadCheckObserver::~PreloadCheckObserver() {}
14
15 void PreloadCheckObserver::OnCheckComplete(PreloadCheck::Errors errors) {
16 CHECK(!called_);
Devlin 2017/03/14 01:44:34 Can we ASSERT_FALSE here?
michaelpg 2017/03/14 21:58:30 I'd prefer not to #include gtest.h here. I'd rathe
Devlin 2017/03/16 01:42:44 Any particular reason? It's already a test-only f
michaelpg 2017/03/17 02:34:26 Meh. The crash does look uglier, so Done.
17 called_ = true;
18 errors_ = errors;
19 }
20
21 void PreloadCheckObserver::Wait() {
22 if (called_)
23 return;
24
25 base::RunLoop().RunUntilIdle();
Devlin 2017/03/14 01:44:34 This can be pretty finicky, given post task comple
michaelpg 2017/03/14 21:58:30 Can you expand on "finicky", please? I copied this
Devlin 2017/03/16 01:42:44 The finicky bits are when RunUntilIdle() doesn't a
michaelpg 2017/03/17 02:34:26 Meh again. How about using two functions, WaitForC
26 }
27
28 } // namespace extensions
OLDNEW
« extensions/browser/preload_check_test_util.h ('K') | « extensions/browser/preload_check_test_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698