Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Side by Side Diff: components/cronet/ios/test/cronet_acceptlang_test.mm

Issue 2665703002: [cronet] Make getAcceptLanguages index a static table instead of the application bundle. (Closed)
Patch Set: small fixes Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/cronet/ios/test/BUILD.gn ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
mef 2017/02/06 16:21:05 nit: 2017
lilyhoughton 2017/02/06 17:54:55 Done.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #import <Cronet/Cronet.h>
6 #import <Foundation/Foundation.h>
7
8 #include "testing/gtest/include/gtest/gtest.h"
9
10 @interface Cronet (ExposedForTesting)
11 + (NSString*)getAcceptLanguagesFromNSLocale:(NSLocale*)locale;
12 @end
13
14 namespace cronet {
15
16 #define EXPECT_NSEQ(a, b) EXPECT_TRUE([(a) isEqual:(b)])
17
18 TEST(AcceptLangTest, Region) {
19 NSString* acceptLangs = [Cronet
20 getAcceptLanguagesFromNSLocale:[NSLocale
21 localeWithLocaleIdentifier:@"en-GB"]];
22
23 EXPECT_NSEQ(acceptLangs, @"en-GB,en-US,en");
24 }
25
26 TEST(AcceptLangTest, Lang) {
27 NSString* acceptLangs = [Cronet
28 getAcceptLanguagesFromNSLocale:[NSLocale
29 localeWithLocaleIdentifier:@"ja-JP"]];
mef 2017/02/06 16:21:05 did you mean to specify just 'ja'?
lilyhoughton 2017/02/06 17:54:55 No, this is testing the behavior that if a languag
mef 2017/02/16 19:20:29 Acknowledged.
30
31 EXPECT_NSEQ(acceptLangs, @"ja,en-US,en");
32 }
33
34 TEST(AcceptLangTest, Default) {
35 NSString* acceptLangs =
36 [Cronet getAcceptLanguagesFromNSLocale:
37 [NSLocale localeWithLocaleIdentifier:@"lol-LOL"]];
38
39 EXPECT_NSEQ(acceptLangs, @"en-US,en");
40 }
41 }
OLDNEW
« no previous file with comments | « components/cronet/ios/test/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698