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

Side by Side Diff: extensions/renderer/api_invocation_errors_unittest.cc

Issue 2837023003: [Extensions Bindings] Add argument parsing errors (Closed)
Patch Set: rebase Created 3 years, 8 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/renderer/api_invocation_errors.h"
6
7 #include "testing/gtest/include/gtest/gtest.h"
8
9 namespace extensions {
10 namespace api_errors {
11
12 // Tests chaining errors for more complicated errors. More of a set of example
13 // strings than a test of the logic itself (which is pretty simple).
14 TEST(APIInvocationErrors, ChainedErrors) {
15 EXPECT_EQ(
16 "Error at index 0: Invalid type: expected string, found integer.",
17 GetIndexError(0, GetError(kInvalidType, kTypeString, kTypeInteger)));
18 EXPECT_EQ(
19 "Error at property 'foo': Invalid type: expected string, found integer.",
20 GetPropertyError("foo",
21 GetError(kInvalidType, kTypeString, kTypeInteger)));
22 EXPECT_EQ(
23 "Error at property 'foo': Error at index 1: "
24 "Invalid type: expected string, found integer.",
25 GetPropertyError(
26 "foo",
27 GetIndexError(1, GetError(kInvalidType, kTypeString, kTypeInteger))));
28 }
29
30 } // namespace api_errors
31 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698