OLD | NEW |
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 <openssl/evp.h> | 5 #include <openssl/evp.h> |
6 #include <openssl/rsa.h> | 6 #include <openssl/rsa.h> |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <stdlib.h> | 9 #include <stdlib.h> |
10 | 10 |
11 #include <memory> | 11 #include <memory> |
12 #include <string> | 12 #include <string> |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "base/bind.h" | 15 #include "base/bind.h" |
16 #include "base/callback.h" | 16 #include "base/callback.h" |
17 #include "base/files/file_path.h" | 17 #include "base/files/file_path.h" |
18 #include "base/files/file_util.h" | 18 #include "base/files/file_util.h" |
19 #include "base/run_loop.h" | 19 #include "base/run_loop.h" |
20 #include "base/strings/string_number_conversions.h" | 20 #include "base/strings/string_number_conversions.h" |
21 #include "base/strings/utf_string_conversions.h" | 21 #include "base/strings/utf_string_conversions.h" |
22 #include "base/values.h" | 22 #include "base/values.h" |
23 #include "chrome/browser/extensions/extension_apitest.h" | 23 #include "chrome/browser/extensions/extension_apitest.h" |
24 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 24 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
25 #include "chrome/test/base/ui_test_utils.h" | 25 #include "chrome/test/base/ui_test_utils.h" |
26 #include "components/policy/core/browser/browser_policy_connector.h" | 26 #include "components/policy/core/browser/browser_policy_connector.h" |
27 #include "components/policy/core/common/mock_configuration_policy_provider.h" | 27 #include "components/policy/core/common/mock_configuration_policy_provider.h" |
28 #include "components/policy/core/common/policy_map.h" | 28 #include "components/policy/core/common/policy_map.h" |
29 #include "components/policy/core/common/policy_types.h" | 29 #include "components/policy/core/common/policy_types.h" |
| 30 #include "components/policy/policy_constants.h" |
30 #include "content/public/browser/render_frame_host.h" | 31 #include "content/public/browser/render_frame_host.h" |
31 #include "content/public/browser/web_contents.h" | 32 #include "content/public/browser/web_contents.h" |
32 #include "content/public/test/test_navigation_observer.h" | 33 #include "content/public/test/test_navigation_observer.h" |
33 #include "content/public/test/test_utils.h" | 34 #include "content/public/test/test_utils.h" |
34 #include "crypto/rsa_private_key.h" | 35 #include "crypto/rsa_private_key.h" |
35 #include "crypto/scoped_openssl_types.h" | 36 #include "crypto/scoped_openssl_types.h" |
36 #include "extensions/common/extension.h" | 37 #include "extensions/common/extension.h" |
37 #include "extensions/test/result_catcher.h" | 38 #include "extensions/test/result_catcher.h" |
38 #include "net/test/spawned_test_server/spawned_test_server.h" | 39 #include "net/test/spawned_test_server/spawned_test_server.h" |
39 #include "policy/policy_constants.h" | |
40 #include "testing/gmock/include/gmock/gmock.h" | 40 #include "testing/gmock/include/gmock/gmock.h" |
41 | 41 |
42 using testing::Return; | 42 using testing::Return; |
43 using testing::_; | 43 using testing::_; |
44 | 44 |
45 namespace { | 45 namespace { |
46 | 46 |
47 void IgnoreResult(const base::Closure& callback, const base::Value* value) { | 47 void IgnoreResult(const base::Closure& callback, const base::Value* value) { |
48 callback.Run(); | 48 callback.Run(); |
49 } | 49 } |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 base::RunLoop run_loop; | 260 base::RunLoop run_loop; |
261 const std::string code = "replyWithSignatureSecondTime();"; | 261 const std::string code = "replyWithSignatureSecondTime();"; |
262 bool result = false; | 262 bool result = false; |
263 extension_contents->GetMainFrame()->ExecuteJavaScriptForTests( | 263 extension_contents->GetMainFrame()->ExecuteJavaScriptForTests( |
264 base::ASCIIToUTF16(code), | 264 base::ASCIIToUTF16(code), |
265 base::Bind(&StoreBool, &result, run_loop.QuitClosure())); | 265 base::Bind(&StoreBool, &result, run_loop.QuitClosure())); |
266 run_loop.Run(); | 266 run_loop.Run(); |
267 EXPECT_TRUE(result); | 267 EXPECT_TRUE(result); |
268 } | 268 } |
269 } | 269 } |
OLD | NEW |