| 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 "chrome/browser/chromeos/certificate_provider/certificate_provider_serv
ice.h" | 5 #include "chrome/browser/chromeos/certificate_provider/certificate_provider_serv
ice.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/stl_util.h" | 13 #include "base/stl_util.h" |
| 14 #include "base/test/test_mock_time_task_runner.h" | 14 #include "base/test/test_mock_time_task_runner.h" |
| 15 #include "base/threading/thread_task_runner_handle.h" | 15 #include "base/threading/thread_task_runner_handle.h" |
| 16 #include "chrome/browser/chromeos/certificate_provider/certificate_provider.h" | 16 #include "chrome/browser/chromeos/certificate_provider/certificate_provider.h" |
| 17 #include "chrome/browser/chromeos/options/request_pin_view.h" |
| 17 #include "net/base/net_errors.h" | 18 #include "net/base/net_errors.h" |
| 18 #include "net/ssl/client_key_store.h" | 19 #include "net/ssl/client_key_store.h" |
| 19 #include "net/test/cert_test_util.h" | 20 #include "net/test/cert_test_util.h" |
| 20 #include "net/test/test_data_directory.h" | 21 #include "net/test/test_data_directory.h" |
| 21 #include "testing/gtest/include/gtest/gtest.h" | 22 #include "testing/gtest/include/gtest/gtest.h" |
| 22 | 23 |
| 23 namespace chromeos { | 24 namespace chromeos { |
| 24 | 25 |
| 25 namespace { | 26 namespace { |
| 26 | 27 |
| (...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 // unloaded. | 479 // unloaded. |
| 479 EXPECT_EQ(net::OK, error); | 480 EXPECT_EQ(net::OK, error); |
| 480 | 481 |
| 481 // Unload the extension. | 482 // Unload the extension. |
| 482 service_->OnExtensionUnloaded(kExtension1); | 483 service_->OnExtensionUnloaded(kExtension1); |
| 483 | 484 |
| 484 task_runner_->RunUntilIdle(); | 485 task_runner_->RunUntilIdle(); |
| 485 EXPECT_EQ(net::ERR_FAILED, error); | 486 EXPECT_EQ(net::ERR_FAILED, error); |
| 486 } | 487 } |
| 487 | 488 |
| 489 TEST_F(CertificateProviderServiceTest, CloseDialogNoExtension) { |
| 490 bool closed = service_->CloseDialog(std::string("extension_id")); |
| 491 ASSERT_FALSE(closed); |
| 492 } |
| 493 |
| 494 TEST_F(CertificateProviderServiceTest, LastDialogClosed) { |
| 495 std::string extension_id("extension_id"); |
| 496 service_->OnPinDialogInput(extension_id, true); |
| 497 ASSERT_TRUE(service_->LastPinDialogClosed(extension_id)); |
| 498 } |
| 499 |
| 488 } // namespace chromeos | 500 } // namespace chromeos |
| OLD | NEW |