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
3 // found in the LICENSE file.
5 #ifndef EXTENSIONS_COMMON_PERMISSIONS_PERMISSION_MESSAGE_TEST_UTIL_H_
6 #define EXTENSIONS_COMMON_PERMISSIONS_PERMISSION_MESSAGE_TEST_UTIL_H_
11 #include "base/strings/string16.h"
12 #include "extensions/common/manifest.h"
13 #include "testing/gtest/include/gtest/gtest.h"
15 namespace extensions
{
17 class PermissionsData
;
20 testing::AssertionResult
VerifyHasPermissionMessage(
21 const PermissionsData
* permissions_data
,
22 const std::string
& expected_message
);
23 testing::AssertionResult
VerifyHasPermissionMessage(
24 const PermissionsData
* permissions_data
,
25 const base::string16
& expected_message
);
26 testing::AssertionResult
VerifyHasPermissionMessage(
27 const PermissionSet
* permissions
,
28 Manifest::Type extension_type
,
29 const std::string
& expected_message
);
30 testing::AssertionResult
VerifyHasPermissionMessage(
31 const PermissionSet
* permissions
,
32 Manifest::Type extension_type
,
33 const base::string16
& expected_message
);
35 testing::AssertionResult
VerifyNoPermissionMessages(
36 const PermissionsData
* permissions_data
);
38 testing::AssertionResult
VerifyOnePermissionMessage(
39 const PermissionsData
* permissions_data
,
40 const std::string
& expected_message
);
41 testing::AssertionResult
VerifyOnePermissionMessage(
42 const PermissionsData
* permissions_data
,
43 const base::string16
& expected_message
);
44 testing::AssertionResult
VerifyOnePermissionMessage(
45 const PermissionSet
* permissions
,
46 Manifest::Type extension_type
,
47 const base::string16
& expected_message
);
49 testing::AssertionResult
VerifyOnePermissionMessageWithSubmessages(
50 const PermissionsData
* permissions_data
,
51 const std::string
& expected_message
,
52 const std::vector
<std::string
>& expected_submessages
);
53 testing::AssertionResult
VerifyOnePermissionMessageWithSubmessages(
54 const PermissionsData
* permissions_data
,
55 const base::string16
& expected_message
,
56 const std::vector
<base::string16
>& expected_submessages
);
58 testing::AssertionResult
VerifyTwoPermissionMessages(
59 const PermissionsData
* permissions_data
,
60 const std::string
& expected_message_1
,
61 const std::string
& expected_message_2
,
63 testing::AssertionResult
VerifyTwoPermissionMessages(
64 const PermissionsData
* permissions_data
,
65 const base::string16
& expected_message_1
,
66 const base::string16
& expected_message_2
,
69 testing::AssertionResult
VerifyPermissionMessages(
70 const PermissionsData
* permissions_data
,
71 const std::vector
<std::string
>& expected_messages
,
73 testing::AssertionResult
VerifyPermissionMessages(
74 const PermissionsData
* permissions_data
,
75 const std::vector
<base::string16
>& expected_messages
,
78 testing::AssertionResult
VerifyPermissionMessagesWithSubmessages(
79 const PermissionsData
* permissions_data
,
80 const std::vector
<std::string
>& expected_messages
,
81 const std::vector
<std::vector
<std::string
>>& expected_submessages
,
83 testing::AssertionResult
VerifyPermissionMessagesWithSubmessages(
84 const PermissionsData
* permissions_data
,
85 const std::vector
<base::string16
>& expected_messages
,
86 const std::vector
<std::vector
<base::string16
>>& expected_submessages
,
89 } // namespace extensions
91 #endif // EXTENSIONS_COMMON_PERMISSIONS_PERMISSION_MESSAGE_TEST_UTIL_H_