| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 #include <stdlib.h> | 7 #include <stdlib.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 void StoreString(std::string* result, | 65 void StoreString(std::string* result, |
| 66 const base::Closure& callback, | 66 const base::Closure& callback, |
| 67 const base::Value* value) { | 67 const base::Value* value) { |
| 68 value->GetAsString(result); | 68 value->GetAsString(result); |
| 69 callback.Run(); | 69 callback.Run(); |
| 70 } | 70 } |
| 71 | 71 |
| 72 void StoreDigest(std::vector<uint8_t>* digest, | 72 void StoreDigest(std::vector<uint8_t>* digest, |
| 73 const base::Closure& callback, | 73 const base::Closure& callback, |
| 74 const base::Value* value) { | 74 const base::Value* value) { |
| 75 const base::BinaryValue* binary = nullptr; | 75 const base::Value* binary = nullptr; |
| 76 const bool is_binary = value->GetAsBinary(&binary); | 76 const bool is_binary = value->GetAsBinary(&binary); |
| 77 EXPECT_TRUE(is_binary) << "Unexpected value in StoreDigest"; | 77 EXPECT_TRUE(is_binary) << "Unexpected value in StoreDigest"; |
| 78 if (is_binary) { | 78 if (is_binary) { |
| 79 const uint8_t* const binary_begin = | 79 const uint8_t* const binary_begin = |
| 80 reinterpret_cast<const uint8_t*>(binary->GetBuffer()); | 80 reinterpret_cast<const uint8_t*>(binary->GetBuffer()); |
| 81 digest->assign(binary_begin, binary_begin + binary->GetSize()); | 81 digest->assign(binary_begin, binary_begin + binary->GetSize()); |
| 82 } | 82 } |
| 83 | 83 |
| 84 callback.Run(); | 84 callback.Run(); |
| 85 } | 85 } |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 chromeos::CertificateProviderService* service = | 421 chromeos::CertificateProviderService* service = |
| 422 LoadRequestPinExtension("request_pin", "basic_lock.html"); | 422 LoadRequestPinExtension("request_pin", "basic_lock.html"); |
| 423 | 423 |
| 424 EnterCode(service, base::ASCIIToUTF16("123")); | 424 EnterCode(service, base::ASCIIToUTF16("123")); |
| 425 service->pin_dialog_manager()->active_window_for_testing()->Close(); | 425 service->pin_dialog_manager()->active_window_for_testing()->Close(); |
| 426 base::RunLoop().RunUntilIdle(); | 426 base::RunLoop().RunUntilIdle(); |
| 427 | 427 |
| 428 // The view should be set to nullptr when the window is closed. | 428 // The view should be set to nullptr when the window is closed. |
| 429 EXPECT_EQ(service->pin_dialog_manager()->active_view_for_testing(), nullptr); | 429 EXPECT_EQ(service->pin_dialog_manager()->active_view_for_testing(), nullptr); |
| 430 } | 430 } |
| OLD | NEW |