OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/strings/stringprintf.h" | 6 #include "base/strings/stringprintf.h" |
7 #include "base/values.h" | 7 #include "base/values.h" |
8 #include "chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_
api.h" | 8 #include "chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_
api.h" |
9 #include "chrome/browser/extensions/extension_api_unittest.h" | 9 #include "chrome/browser/extensions/extension_api_unittest.h" |
10 #include "chrome/browser/extensions/extension_function_test_utils.h" | 10 #include "chrome/browser/extensions/extension_function_test_utils.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 void CopyData(std::string* data_target, const std::string& data_source) { | 47 void CopyData(std::string* data_target, const std::string& data_source) { |
48 *data_target = data_source; | 48 *data_target = data_source; |
49 } | 49 } |
50 | 50 |
51 class EasyUnlockPrivateApiTest : public extensions::ExtensionApiUnittest { | 51 class EasyUnlockPrivateApiTest : public extensions::ExtensionApiUnittest { |
52 public: | 52 public: |
53 EasyUnlockPrivateApiTest() {} | 53 EasyUnlockPrivateApiTest() {} |
54 virtual ~EasyUnlockPrivateApiTest() {} | 54 virtual ~EasyUnlockPrivateApiTest() {} |
55 | 55 |
56 protected: | 56 protected: |
57 virtual void SetUp() OVERRIDE { | 57 virtual void SetUp() override { |
58 chromeos::DBusThreadManager::Initialize(); | 58 chromeos::DBusThreadManager::Initialize(); |
59 client_ = chromeos::DBusThreadManager::Get()->GetEasyUnlockClient(); | 59 client_ = chromeos::DBusThreadManager::Get()->GetEasyUnlockClient(); |
60 | 60 |
61 extensions::ExtensionApiUnittest::SetUp(); | 61 extensions::ExtensionApiUnittest::SetUp(); |
62 } | 62 } |
63 | 63 |
64 virtual void TearDown() OVERRIDE { | 64 virtual void TearDown() override { |
65 extensions::ExtensionApiUnittest::TearDown(); | 65 extensions::ExtensionApiUnittest::TearDown(); |
66 | 66 |
67 chromeos::DBusThreadManager::Shutdown(); | 67 chromeos::DBusThreadManager::Shutdown(); |
68 } | 68 } |
69 | 69 |
70 // Extracts a single binary value result from a run extension function | 70 // Extracts a single binary value result from a run extension function |
71 // |function| and converts it to string. | 71 // |function| and converts it to string. |
72 // It will fail if the extension doesn't have exactly one binary value result. | 72 // It will fail if the extension doesn't have exactly one binary value result. |
73 // On failure, an empty string is returned. | 73 // On failure, an empty string is returned. |
74 std::string GetSingleBinaryResultAsString( | 74 std::string GetSingleBinaryResultAsString( |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 function.get(), | 387 function.get(), |
388 args.Pass(), | 388 args.Pass(), |
389 browser(), | 389 browser(), |
390 extension_function_test_utils::NONE)); | 390 extension_function_test_utils::NONE)); |
391 | 391 |
392 EXPECT_EQ(expected_result, GetSingleBinaryResultAsString(function.get())); | 392 EXPECT_EQ(expected_result, GetSingleBinaryResultAsString(function.get())); |
393 } | 393 } |
394 | 394 |
395 } // namespace | 395 } // namespace |
396 | 396 |
OLD | NEW |