| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/strings/string_tokenizer.h" | 6 #include "base/strings/string_tokenizer.h" |
| 7 #include "content/public/common/content_switches.h" | 7 #include "content/public/common/content_switches.h" |
| 8 #include "content/public/test/browser_test_utils.h" | 8 #include "content/public/test/browser_test_utils.h" |
| 9 #include "content/public/test/content_browser_test.h" | 9 #include "content/public/test/content_browser_test.h" |
| 10 #include "content/public/test/content_browser_test_utils.h" | 10 #include "content/public/test/content_browser_test_utils.h" |
| 11 | 11 |
| 12 namespace content { | 12 namespace content { |
| 13 | 13 |
| 14 // TODO(xianglu): Enable other platforms support. https://crbug.com/646083 | 14 // TODO(xianglu): Enable other platforms support. https://crbug.com/646083 |
| 15 #if defined(OS_ANDROID) || defined(OS_MACOSX) | 15 #if defined(OS_ANDROID) |
| 16 #define MAYBE_ShapeDetectionBrowserTest ShapeDetectionBrowserTest | 16 #define MAYBE_ShapeDetectionBrowserTest ShapeDetectionBrowserTest |
| 17 #else | 17 #else |
| 18 #define MAYBE_ShapeDetectionBrowserTest DISABLED_ShapeDetectionBrowserTest | 18 #define MAYBE_ShapeDetectionBrowserTest DISABLED_ShapeDetectionBrowserTest |
| 19 #endif | 19 #endif |
| 20 | 20 |
| 21 namespace { | 21 namespace { |
| 22 | 22 |
| 23 const char kFaceDetectionTestHtml[] = "/media/face_detection_test.html"; | 23 const char kFaceDetectionTestHtml[] = "/media/face_detection_test.html"; |
| 24 | 24 |
| 25 } // namespace | 25 } // namespace |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 IN_PROC_BROWSER_TEST_F(MAYBE_ShapeDetectionBrowserTest, | 73 IN_PROC_BROWSER_TEST_F(MAYBE_ShapeDetectionBrowserTest, |
| 74 DetectFacesOnImageWithNoFaces) { | 74 DetectFacesOnImageWithNoFaces) { |
| 75 const std::string image_path = "/blank.jpg"; | 75 const std::string image_path = "/blank.jpg"; |
| 76 const std::vector<std::vector<float>> expected_empty_results; | 76 const std::vector<std::vector<float>> expected_empty_results; |
| 77 RunDetectFacesOnImageUrl(image_path, expected_empty_results); | 77 RunDetectFacesOnImageUrl(image_path, expected_empty_results); |
| 78 } | 78 } |
| 79 | 79 |
| 80 IN_PROC_BROWSER_TEST_F(MAYBE_ShapeDetectionBrowserTest, | 80 IN_PROC_BROWSER_TEST_F(MAYBE_ShapeDetectionBrowserTest, |
| 81 DetectFacesOnImageWithOneFace) { | 81 DetectFacesOnImageWithOneFace) { |
| 82 const std::string image_path = "/single_face.jpg"; | 82 const std::string image_path = "/single_face.jpg"; |
| 83 std::vector<std::vector<float>> expected_results; | |
| 84 #if defined(OS_ANDROID) | 83 #if defined(OS_ANDROID) |
| 85 const std::vector<float> expected_result = {68.640625, 102.96875, 171.5625, | 84 const std::vector<std::vector<float>> expected_results{ |
| 86 171.5625}; | 85 {68.640625, 102.96875, 171.5625, 171.5625}}; |
| 87 expected_results.push_back(expected_result); | 86 #else |
| 88 #elif defined(OS_MACOSX) | 87 const std::vector<std::vector<float>> expected_results; |
| 89 const std::vector<float> expected_result = {0, 93, 290, 290}; | |
| 90 expected_results.push_back(expected_result); | |
| 91 #endif | 88 #endif |
| 92 | 89 |
| 93 RunDetectFacesOnImageUrl(image_path, expected_results); | 90 RunDetectFacesOnImageUrl(image_path, expected_results); |
| 94 } | 91 } |
| 95 | 92 |
| 96 } // namespace content | 93 } // namespace content |
| OLD | NEW |