| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/extensions/api/cloud_print_private/cloud_print_private_
api.h" | 5 #include "chrome/browser/extensions/api/cloud_print_private/cloud_print_private_
api.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "chrome/browser/extensions/extension_apitest.h" | 10 #include "chrome/browser/extensions/extension_apitest.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 MOCK_METHOD0(GetHostName, std::string()); | 72 MOCK_METHOD0(GetHostName, std::string()); |
| 73 MOCK_METHOD0(GetPrinters, std::vector<std::string>()); | 73 MOCK_METHOD0(GetPrinters, std::vector<std::string>()); |
| 74 MOCK_METHOD0(GetClientId, std::string()); | 74 MOCK_METHOD0(GetClientId, std::string()); |
| 75 | 75 |
| 76 private: | 76 private: |
| 77 DISALLOW_COPY_AND_ASSIGN(CloudPrintTestsDelegateMock); | 77 DISALLOW_COPY_AND_ASSIGN(CloudPrintTestsDelegateMock); |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 MATCHER(IsExpectedUserSettings, "") { | 80 MATCHER(IsExpectedUserSettings, "") { |
| 81 const UserSettings& settings = arg; | 81 const UserSettings& settings = arg; |
| 82 return settings.connect_new_printers && | 82 return settings.connect_new_printers && settings.printers.size() == 2 && |
| 83 settings.printers.size() == 2 && | 83 settings.printers[0].name == "printer1" && |
| 84 settings.printers[0]->name == "printer1" && | 84 !settings.printers[0].connect && |
| 85 !settings.printers[0]->connect && | 85 settings.printers[1].name == "printer2" && |
| 86 settings.printers[1]->name == "printer2" && | 86 settings.printers[1].connect; |
| 87 settings.printers[1]->connect; | |
| 88 } | 87 } |
| 89 | 88 |
| 90 // http://crbug.com/177163 | 89 // http://crbug.com/177163 |
| 91 #if defined(OS_WIN) && !defined(NDEBUG) | 90 #if defined(OS_WIN) && !defined(NDEBUG) |
| 92 #define MAYBE_CloudPrintHosted DISABLED_CloudPrintHosted | 91 #define MAYBE_CloudPrintHosted DISABLED_CloudPrintHosted |
| 93 #else | 92 #else |
| 94 #define MAYBE_CloudPrintHosted CloudPrintHosted | 93 #define MAYBE_CloudPrintHosted CloudPrintHosted |
| 95 #endif | 94 #endif |
| 96 IN_PROC_BROWSER_TEST_F(ExtensionCloudPrintPrivateApiTest, | 95 IN_PROC_BROWSER_TEST_F(ExtensionCloudPrintPrivateApiTest, |
| 97 MAYBE_CloudPrintHosted) { | 96 MAYBE_CloudPrintHosted) { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 116 | 115 |
| 117 // Run this as a hosted app. Since we have overridden the cloud print service | 116 // Run this as a hosted app. Since we have overridden the cloud print service |
| 118 // URL in the command line, this URL should match the web extent for our | 117 // URL in the command line, this URL should match the web extent for our |
| 119 // cloud print component app and it should work. | 118 // cloud print component app and it should work. |
| 120 GURL page_url = GetTestServerURL( | 119 GURL page_url = GetTestServerURL( |
| 121 "enable_chrome_connector/cloud_print_success_tests.html"); | 120 "enable_chrome_connector/cloud_print_success_tests.html"); |
| 122 ASSERT_TRUE(RunPageTest(page_url.spec())); | 121 ASSERT_TRUE(RunPageTest(page_url.spec())); |
| 123 } | 122 } |
| 124 | 123 |
| 125 #endif // !defined(OS_CHROMEOS) | 124 #endif // !defined(OS_CHROMEOS) |
| OLD | NEW |