OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 } | 236 } |
237 | 237 |
238 IN_PROC_BROWSER_TEST_F(ComponentCloudPolicyTest, InstallNewExtension) { | 238 IN_PROC_BROWSER_TEST_F(ComponentCloudPolicyTest, InstallNewExtension) { |
239 EXPECT_TRUE(test_server_.UpdatePolicyData( | 239 EXPECT_TRUE(test_server_.UpdatePolicyData( |
240 dm_protocol::kChromeExtensionPolicyType, kTestExtension2, kTestPolicy2)); | 240 dm_protocol::kChromeExtensionPolicyType, kTestExtension2, kTestPolicy2)); |
241 | 241 |
242 ExtensionTestMessageListener result_listener("ok", true); | 242 ExtensionTestMessageListener result_listener("ok", true); |
243 result_listener.AlsoListenForFailureMessage("fail"); | 243 result_listener.AlsoListenForFailureMessage("fail"); |
244 scoped_refptr<const extensions::Extension> extension2 = | 244 scoped_refptr<const extensions::Extension> extension2 = |
245 LoadExtension(kTestExtension2Path); | 245 LoadExtension(kTestExtension2Path); |
246 ASSERT_TRUE(extension2); | 246 ASSERT_TRUE(extension2.get()); |
247 ASSERT_EQ(kTestExtension2, extension2->id()); | 247 ASSERT_EQ(kTestExtension2, extension2->id()); |
248 | 248 |
249 // This extension only sends the 'policy' signal once it receives the policy, | 249 // This extension only sends the 'policy' signal once it receives the policy, |
250 // and after verifying it has the expected value. Otherwise it sends 'fail'. | 250 // and after verifying it has the expected value. Otherwise it sends 'fail'. |
251 EXPECT_TRUE(result_listener.WaitUntilSatisfied()); | 251 EXPECT_TRUE(result_listener.WaitUntilSatisfied()); |
252 } | 252 } |
253 | 253 |
254 #endif // OS_CHROMEOS | 254 #endif // OS_CHROMEOS |
255 | 255 |
256 } // namespace policy | 256 } // namespace policy |
OLD | NEW |