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

Side by Side Diff: mojo/runner/native_runner_unittest.cc

Issue 1402533003: Don't use base::MessageLoop::{Quit,QuitClosure} in mojo/ (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
« no previous file with comments | « mojo/runner/context.cc ('k') | mojo/runner/shell_apptest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/files/scoped_temp_dir.h" 5 #include "base/files/scoped_temp_dir.h"
6 #include "base/path_service.h" 6 #include "base/path_service.h"
7 #include "mojo/package_manager/package_manager_impl.h" 7 #include "mojo/package_manager/package_manager_impl.h"
8 #include "mojo/runner/context.h" 8 #include "mojo/runner/context.h"
9 #include "mojo/shell/application_manager.h" 9 #include "mojo/shell/application_manager.h"
10 #include "mojo/util/filename_util.h" 10 #include "mojo/util/filename_util.h"
(...skipping 15 matching lines...) Expand all
26 }; 26 };
27 27
28 class TestNativeRunner : public shell::NativeRunner { 28 class TestNativeRunner : public shell::NativeRunner {
29 public: 29 public:
30 explicit TestNativeRunner(TestState* state) : state_(state) { 30 explicit TestNativeRunner(TestState* state) : state_(state) {
31 state_->runner_was_created = true; 31 state_->runner_was_created = true;
32 } 32 }
33 ~TestNativeRunner() override { 33 ~TestNativeRunner() override {
34 state_->runner_was_destroyed = true; 34 state_->runner_was_destroyed = true;
35 if (base::MessageLoop::current()->is_running()) 35 if (base::MessageLoop::current()->is_running())
36 base::MessageLoop::current()->Quit(); 36 base::MessageLoop::current()->QuitWhenIdle();
37 } 37 }
38 void Start(const base::FilePath& app_path, 38 void Start(const base::FilePath& app_path,
39 bool start_sandboxed, 39 bool start_sandboxed,
40 InterfaceRequest<Application> application_request, 40 InterfaceRequest<Application> application_request,
41 const base::Closure& app_completed_callback) override { 41 const base::Closure& app_completed_callback) override {
42 state_->runner_was_started = true; 42 state_->runner_was_started = true;
43 } 43 }
44 44
45 private: 45 private:
46 TestState* state_; 46 TestState* state_;
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 params->SetTargetURL(url); 95 params->SetTargetURL(url);
96 application_manager_->ConnectToApplication(params.Pass()); 96 application_manager_->ConnectToApplication(params.Pass());
97 EXPECT_FALSE(state_.runner_was_created); 97 EXPECT_FALSE(state_.runner_was_created);
98 EXPECT_FALSE(state_.runner_was_started); 98 EXPECT_FALSE(state_.runner_was_started);
99 EXPECT_FALSE(state_.runner_was_destroyed); 99 EXPECT_FALSE(state_.runner_was_destroyed);
100 } 100 }
101 101
102 } // namespace 102 } // namespace
103 } // namespace runner 103 } // namespace runner
104 } // namespace mojo 104 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/runner/context.cc ('k') | mojo/runner/shell_apptest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698