Commit 0a30b3b1 authored by bzanotti's avatar bzanotti Committed by Commit bot

iOS: Re-add bits of GTM we actually use.

Also adds a unit test using the function that is used downstream to
prevent this from happening again.

BUG=630260

Review-Url: https://codereview.chromium.org/2173873002
Cr-Commit-Position: refs/heads/master@{#407213}
parent 40fa5a0e
......@@ -77,6 +77,7 @@ test("ios_chrome_unittests") {
"browser/web_resource/web_resource_util_unittest.cc",
"browser/webp_transcode/webp_decoder_unittest.mm",
"common/string_util_unittest.mm",
"test/google_toolbox_unittest.mm",
]
deps = [
......@@ -116,6 +117,7 @@ test("ios_chrome_unittests") {
"//skia",
"//testing/gmock",
"//testing/gtest",
"//third_party/google_toolbox_for_mac",
"//third_party/ocmock",
"//ui/gfx:test_support",
]
......
......@@ -29,6 +29,7 @@
'../../skia/skia.gyp:skia',
'../../testing/gmock.gyp:gmock',
'../../testing/gtest.gyp:gtest',
'../../third_party/google_toolbox_for_mac/google_toolbox_for_mac.gyp:google_toolbox_for_mac',
'../../third_party/ocmock/ocmock.gyp:ocmock',
'../../ui/gfx/gfx.gyp:gfx',
'../../ui/gfx/gfx.gyp:gfx_test_support',
......@@ -90,6 +91,7 @@
'browser/web_resource/web_resource_util_unittest.cc',
'browser/webp_transcode/webp_decoder_unittest.mm',
'common/string_util_unittest.mm',
'test/google_toolbox_unittest.mm',
],
'actions': [
{
......
......@@ -6,5 +6,6 @@ include_rules = [
"+ios/public/test",
"+ios/web/public",
"+net/url_request",
"+third_party/google_toolbox_for_mac",
"+ui",
]
// Copyright (c) 2016 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 <Foundation/Foundation.h>
#include "base/logging.h"
#include "testing/gtest_mac.h"
#import "third_party/google_toolbox_for_mac/src/Foundation/GTMNSDictionary+URLArguments.h"
// [NSDictionary gtm_dictionaryWithHttpArgumentsString] is used downstream.
// This test ensures that we keep compiling the file.
TEST(GoogleToolboxForMacTest, dictionaryWithHttpArgumentsString) {
NSDictionary* dict = [NSDictionary gtm_dictionaryWithHttpArgumentsString:@""];
EXPECT_EQ(0u, [dict count]);
}
......@@ -60,12 +60,16 @@ component("google_toolbox_for_mac") {
]
} else { # is_ios
sources += [
"src/DebugUtils/GTMMethodCheck.h",
"src/DebugUtils/GTMMethodCheck.m",
"src/Foundation/GTMLightweightProxy.h",
"src/Foundation/GTMLightweightProxy.m",
# GTMLogger is used by breakpad, which is still used on iOS.
"src/Foundation/GTMLogger.h",
"src/Foundation/GTMLogger.m",
"src/Foundation/GTMNSDictionary+URLArguments.h",
"src/Foundation/GTMNSDictionary+URLArguments.m",
"src/Foundation/GTMNSString+URLArguments.h",
"src/Foundation/GTMNSString+URLArguments.m",
"src/iPhone/GTMFadeTruncatingLabel.h",
......
......@@ -45,11 +45,15 @@
'src/AppKit/GTMUILocalizerAndLayoutTweaker.h',
'src/AppKit/GTMUILocalizerAndLayoutTweaker.m',
'src/DebugUtils/GTMDebugSelectorValidation.h',
'src/DebugUtils/GTMMethodCheck.h',
'src/DebugUtils/GTMMethodCheck.m',
'src/DebugUtils/GTMTypeCasting.h',
'src/Foundation/GTMLightweightProxy.h',
'src/Foundation/GTMLightweightProxy.m',
'src/Foundation/GTMLogger.h',
'src/Foundation/GTMLogger.m',
'src/Foundation/GTMNSDictionary+URLArguments.h',
'src/Foundation/GTMNSDictionary+URLArguments.m',
'src/Foundation/GTMNSString+URLArguments.h',
'src/Foundation/GTMNSString+URLArguments.m',
'src/Foundation/GTMServiceManagement.c',
......@@ -83,7 +87,9 @@
['OS!="ios"', {
'sources/': [
['exclude', '^src/iPhone/'],
['exclude', '^src/DebugUtils/GTMMethodCheck\\.m$'],
['exclude', '^src/Foundation/GTMLogger\\.m$'],
['exclude', '^src/Foundation/GTMNSDictionary\\+URLArguments\\.m$'],
],
'link_settings': {
'libraries': [
......@@ -98,8 +104,10 @@
'sources/': [
# Exclude everything except what's needed for iOS.
['exclude', '\\.(c|m)$'],
['include', '^src/DebugUtils/GTMMethodCheck\\.m$'],
['include', '^src/Foundation/GTMLightweightProxy\\.m$'],
['include', '^src/Foundation/GTMLogger\\.m$'],
['include', '^src/Foundation/GTMNSDictionary\\+URLArguments\\.m$'],
['include', '^src/Foundation/GTMNSString\\+URLArguments\\.m$'],
['include', '^src/Foundation/GTMStringEncoding\\.m$'],
['include', '^src/iPhone/'],
......
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