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

Side by Side Diff: shell/dynamic_application_loader_unittest.cc

Issue 865253002: Delete temporary application file as soon as the application is launched. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Follow review Created 5 years, 11 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 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 "shell/context.h" 6 #include "shell/context.h"
7 #include "shell/dynamic_application_loader.h" 7 #include "shell/dynamic_application_loader.h"
8 #include "shell/dynamic_service_runner.h" 8 #include "shell/dynamic_service_runner.h"
9 #include "shell/filename_util.h" 9 #include "shell/filename_util.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 17 matching lines...) Expand all
28 class TestDynamicServiceRunner : public DynamicServiceRunner { 28 class TestDynamicServiceRunner : public DynamicServiceRunner {
29 public: 29 public:
30 explicit TestDynamicServiceRunner(TestState* state) : state_(state) { 30 explicit TestDynamicServiceRunner(TestState* state) : state_(state) {
31 state_->runner_was_created = true; 31 state_->runner_was_created = true;
32 } 32 }
33 ~TestDynamicServiceRunner() override { 33 ~TestDynamicServiceRunner() override {
34 state_->runner_was_destroyed = true; 34 state_->runner_was_destroyed = true;
35 base::MessageLoop::current()->Quit(); 35 base::MessageLoop::current()->Quit();
36 } 36 }
37 void Start(const base::FilePath& app_path, 37 void Start(const base::FilePath& app_path,
38 DynamicServiceRunner::CleanupBehavior cleanup_behavior,
38 ScopedMessagePipeHandle service_handle, 39 ScopedMessagePipeHandle service_handle,
39 const base::Closure& app_completed_callback) override { 40 const base::Closure& app_completed_callback) override {
40 state_->runner_was_started = true; 41 state_->runner_was_started = true;
41 } 42 }
42 43
43 private: 44 private:
44 TestState* state_; 45 TestState* state_;
45 }; 46 };
46 47
47 class TestDynamicServiceRunnerFactory : public DynamicServiceRunnerFactory { 48 class TestDynamicServiceRunnerFactory : public DynamicServiceRunnerFactory {
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 auto throwaway = GetProxy(&shell); 87 auto throwaway = GetProxy(&shell);
87 loader_->Load(context_.application_manager(), url, shell.Pass(), 88 loader_->Load(context_.application_manager(), url, shell.Pass(),
88 ApplicationLoader::SimpleLoadCallback()); 89 ApplicationLoader::SimpleLoadCallback());
89 EXPECT_FALSE(state_.runner_was_created); 90 EXPECT_FALSE(state_.runner_was_created);
90 EXPECT_FALSE(state_.runner_was_started); 91 EXPECT_FALSE(state_.runner_was_started);
91 EXPECT_FALSE(state_.runner_was_destroyed); 92 EXPECT_FALSE(state_.runner_was_destroyed);
92 } 93 }
93 94
94 } // namespace shell 95 } // namespace shell
95 } // namespace mojo 96 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698