Commit 2ebf1195 authored by lod's avatar lod Committed by Commit bot

Add unit test and showcase support for search widget.

BUG=622743

Review-Url: https://codereview.chromium.org/2810403003
Cr-Commit-Position: refs/heads/master@{#465645}
parent 17e49b08
...@@ -20,6 +20,21 @@ compile_plist("entitlements") { ...@@ -20,6 +20,21 @@ compile_plist("entitlements") {
} }
ios_appex_bundle("search_widget_extension") { ios_appex_bundle("search_widget_extension") {
deps = [
":search_widget",
]
extra_substitutions = [
"CHROME_CHANNEL_SCHEME=$url_channel_scheme",
"CHROMIUM_SHORT_NAME=$chromium_short_name",
"WIDGET_EXTENSION_BUNDLE_ID=$chromium_bundle_id.SearchTodayExtension",
]
entitlements_target = ":entitlements"
info_plist_target = ":tweak_info_plist"
}
source_set("search_widget") {
sources = [ sources = [
"search_widget_view.h", "search_widget_view.h",
"search_widget_view.mm", "search_widget_view.mm",
...@@ -30,17 +45,7 @@ ios_appex_bundle("search_widget_extension") { ...@@ -30,17 +45,7 @@ ios_appex_bundle("search_widget_extension") {
deps = [ deps = [
"//base", "//base",
"//components/open_from_clipboard:open_from_clipboard_impl", "//components/open_from_clipboard:open_from_clipboard_impl",
"//components/prefs",
"//components/variations",
"//components/version_info",
"//ios/chrome/common",
"//ios/chrome/common/app_group", "//ios/chrome/common/app_group",
"//ios/chrome/common/app_group:client",
"//ios/chrome/common/physical_web",
"//ios/chrome/today_extension/strings",
"//ios/third_party/material_components_ios",
"//net",
"//ui/base",
] ]
libs = [ libs = [
...@@ -49,14 +54,17 @@ ios_appex_bundle("search_widget_extension") { ...@@ -49,14 +54,17 @@ ios_appex_bundle("search_widget_extension") {
"UIKit.framework", "UIKit.framework",
] ]
extra_substitutions = [
"CHROME_CHANNEL_SCHEME=$url_channel_scheme",
"CHROMIUM_SHORT_NAME=$chromium_short_name",
"WIDGET_EXTENSION_BUNDLE_ID=$chromium_bundle_id.SearchTodayExtension",
]
configs += [ "//build/config/compiler:enable_arc" ] configs += [ "//build/config/compiler:enable_arc" ]
}
entitlements_target = ":entitlements" source_set("unit_tests") {
info_plist_target = ":tweak_info_plist" testonly = true
sources = [
"search_widget_view_controller_unittest.mm",
]
deps = [
":search_widget",
"//testing/gtest",
]
configs += [ "//build/config/compiler:enable_arc" ]
} }
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import "ios/chrome/search_widget_extension/search_widget_view_controller.h"
#import "ios/chrome/search_widget_extension/search_widget_view_controller.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
using SearchWidgetViewControllerTest = PlatformTest;
TEST_F(SearchWidgetViewControllerTest, Alloc) {
SearchWidgetViewController* controller =
[[SearchWidgetViewController alloc] init];
ASSERT_NE(controller, nil);
}
...@@ -189,6 +189,7 @@ test("ios_chrome_unittests") { ...@@ -189,6 +189,7 @@ test("ios_chrome_unittests") {
"//ios/chrome/browser/web_resource:unit_tests", "//ios/chrome/browser/web_resource:unit_tests",
"//ios/chrome/browser/web_state_list:unit_tests", "//ios/chrome/browser/web_state_list:unit_tests",
"//ios/chrome/common:unit_tests", "//ios/chrome/common:unit_tests",
"//ios/chrome/search_widget_extension:unit_tests",
"//ios/chrome/test/base:unit_tests", "//ios/chrome/test/base:unit_tests",
"//ios/shared/chrome/browser/ui/browser_list:unit_tests", "//ios/shared/chrome/browser/ui/browser_list:unit_tests",
"//ios/shared/chrome/browser/ui/commands:unit_tests", "//ios/shared/chrome/browser/ui/commands:unit_tests",
......
...@@ -25,6 +25,7 @@ ios_app_bundle("showcase") { ...@@ -25,6 +25,7 @@ ios_app_bundle("showcase") {
group("features") { group("features") {
deps = [ deps = [
"//ios/chrome/search_widget_extension:search_widget",
"//ios/clean/chrome/browser/ui/tools:tools_ui", "//ios/clean/chrome/browser/ui/tools:tools_ui",
"//ios/showcase/content_suggestions", "//ios/showcase/content_suggestions",
"//ios/showcase/ntp", "//ios/showcase/ntp",
......
...@@ -81,6 +81,11 @@ ...@@ -81,6 +81,11 @@
showcase::kClassForInstantiationKey : @"UIKitTableViewCellViewController", showcase::kClassForInstantiationKey : @"UIKitTableViewCellViewController",
showcase::kUseCaseKey : @"UIKit Table Cells", showcase::kUseCaseKey : @"UIKit Table Cells",
}, },
@{
showcase::kClassForDisplayKey : @"SearchWidgetViewController",
showcase::kClassForInstantiationKey : @"SearchWidgetViewController",
showcase::kUseCaseKey : @"Search Widget",
},
]; ];
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment