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

Side by Side Diff: shell/android/background_application_loader_unittest.cc

Issue 788243007: Moves BackgroundShellApplicationLoader to shell/android (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: another printf Created 6 years 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 "mojo/application_manager/background_shell_application_loader.h" 5 #include "shell/android/background_application_loader.h"
6 6
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 8
9 namespace mojo { 9 namespace mojo {
10 10
11 namespace { 11 namespace {
12 12
13 class DummyLoader : public ApplicationLoader { 13 class DummyLoader : public ApplicationLoader {
14 public: 14 public:
15 DummyLoader() : simulate_app_quit_(true) {} 15 DummyLoader() : simulate_app_quit_(true) {}
(...skipping 13 matching lines...) Expand all
29 29
30 void DontSimulateAppQuit() { simulate_app_quit_ = false; } 30 void DontSimulateAppQuit() { simulate_app_quit_ = false; }
31 31
32 private: 32 private:
33 bool simulate_app_quit_; 33 bool simulate_app_quit_;
34 }; 34 };
35 35
36 } // namespace 36 } // namespace
37 37
38 // Tests that the loader can start and stop gracefully. 38 // Tests that the loader can start and stop gracefully.
39 TEST(BackgroundShellApplicationLoaderTest, StartStop) { 39 TEST(BackgroundApplicationLoaderTest, StartStop) {
40 scoped_ptr<ApplicationLoader> real_loader(new DummyLoader()); 40 scoped_ptr<ApplicationLoader> real_loader(new DummyLoader());
41 BackgroundShellApplicationLoader loader( 41 BackgroundApplicationLoader loader(real_loader.Pass(), "test",
42 real_loader.Pass(), "test", base::MessageLoop::TYPE_DEFAULT); 42 base::MessageLoop::TYPE_DEFAULT);
43 } 43 }
44 44
45 // Tests that the loader can load a service that is well behaved (quits 45 // Tests that the loader can load a service that is well behaved (quits
46 // itself). 46 // itself).
47 TEST(BackgroundShellApplicationLoaderTest, Load) { 47 TEST(BackgroundApplicationLoaderTest, Load) {
48 scoped_ptr<ApplicationLoader> real_loader(new DummyLoader()); 48 scoped_ptr<ApplicationLoader> real_loader(new DummyLoader());
49 BackgroundShellApplicationLoader loader( 49 BackgroundApplicationLoader loader(real_loader.Pass(), "test",
50 real_loader.Pass(), "test", base::MessageLoop::TYPE_DEFAULT); 50 base::MessageLoop::TYPE_DEFAULT);
51 MessagePipe dummy; 51 MessagePipe dummy;
52 loader.Load(NULL, GURL(), dummy.handle0.Pass(), 52 loader.Load(NULL, GURL(), dummy.handle0.Pass(),
53 ApplicationLoader::SimpleLoadCallback()); 53 ApplicationLoader::SimpleLoadCallback());
54 } 54 }
55 55
56 } // namespace mojo 56 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698