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

Side by Side Diff: extensions/renderer/api/mojo_private/mojo_private_unittest.cc

Issue 862793003: Expose requireAsync method and make it more robust (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed unit test feedback 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "extensions/renderer/api_test_base.h" 5 #include "extensions/renderer/api_test_base.h"
6 6
7 #include "gin/modules/module_registry.h" 7 #include "gin/modules/module_registry.h"
8 8
9 // A test launcher for tests for the mojoPrivate API defined in 9 // A test launcher for tests for the mojoPrivate API defined in
10 // extensions/test/data/mojo_private_unittest.js. 10 // extensions/test/data/mojo_private_unittest.js.
(...skipping 27 matching lines...) Expand all
38 TEST_F(MojoPrivateApiTest, DefineModuleDoesNotExist) { 38 TEST_F(MojoPrivateApiTest, DefineModuleDoesNotExist) {
39 ASSERT_NO_FATAL_FAILURE( 39 ASSERT_NO_FATAL_FAILURE(
40 RunTest("mojo_private_unittest.js", "testDefineModuleDoesNotExist")); 40 RunTest("mojo_private_unittest.js", "testDefineModuleDoesNotExist"));
41 EXPECT_EQ(0u, module_registry()->available_modules().count("testModule")); 41 EXPECT_EQ(0u, module_registry()->available_modules().count("testModule"));
42 EXPECT_EQ(0u, 42 EXPECT_EQ(0u,
43 module_registry()->available_modules().count("does not exist!")); 43 module_registry()->available_modules().count("does not exist!"));
44 EXPECT_EQ(1u, module_registry()->unsatisfied_dependencies().count( 44 EXPECT_EQ(1u, module_registry()->unsatisfied_dependencies().count(
45 "does not exist!")); 45 "does not exist!"));
46 } 46 }
47 47
48 TEST_F(MojoPrivateApiTest, RequireAsync) {
49 ASSERT_NO_FATAL_FAILURE(
50 RunTest("mojo_private_unittest.js", "testRequireAsync"));
51 }
52
53 TEST_F(MojoPrivateApiTest, DefineAndRequire) {
54 ASSERT_NO_FATAL_FAILURE(
55 RunTest("mojo_private_unittest.js", "testDefineAndRequire"));
56 }
57
48 } // namespace extensions 58 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698