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

Side by Side Diff: chrome/common/extensions/features/simple_feature_unittest.cc

Issue 27722003: Windows-specific implementation of Networking Private API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Renamed feature platforms to 'win' and 'mac' to match Platforms from model.py Created 7 years, 1 month 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 | Annotate | Revision Log
OLDNEW
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/common/extensions/features/simple_feature.h" 5 #include "chrome/common/extensions/features/simple_feature.h"
6 6
7 #include "chrome/common/extensions/features/feature_channel.h" 7 #include "chrome/common/extensions/features/feature_channel.h"
8 #include "chrome/common/extensions/value_builder.h" 8 #include "chrome/common/extensions/value_builder.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 value->Set("platforms", platforms); 464 value->Set("platforms", platforms);
465 feature->Parse(value.get()); 465 feature->Parse(value.get());
466 EXPECT_TRUE(feature->platforms()->empty()); 466 EXPECT_TRUE(feature->platforms()->empty());
467 467
468 platforms->AppendString("chromeos"); 468 platforms->AppendString("chromeos");
469 feature->Parse(value.get()); 469 feature->Parse(value.get());
470 EXPECT_FALSE(feature->platforms()->empty()); 470 EXPECT_FALSE(feature->platforms()->empty());
471 EXPECT_EQ(Feature::CHROMEOS_PLATFORM, *feature->platforms()->begin()); 471 EXPECT_EQ(Feature::CHROMEOS_PLATFORM, *feature->platforms()->begin());
472 472
473 platforms->Clear(); 473 platforms->Clear();
474 platforms->AppendString("windows"); 474 platforms->AppendString("win");
475 feature->Parse(value.get()); 475 feature->Parse(value.get());
476 EXPECT_FALSE(feature->platforms()->empty()); 476 EXPECT_FALSE(feature->platforms()->empty());
477 EXPECT_EQ(Feature::WIN_PLATFORM, *feature->platforms()->begin()); 477 EXPECT_EQ(Feature::WIN_PLATFORM, *feature->platforms()->begin());
478 478
479 platforms->Clear(); 479 platforms->Clear();
480 platforms->AppendString("windows"); 480 platforms->AppendString("win");
481 platforms->AppendString("chromeos"); 481 platforms->AppendString("chromeos");
482 feature->Parse(value.get()); 482 feature->Parse(value.get());
483 std::set<Feature::Platform> expected_platforms; 483 std::set<Feature::Platform> expected_platforms;
484 expected_platforms.insert(Feature::CHROMEOS_PLATFORM); 484 expected_platforms.insert(Feature::CHROMEOS_PLATFORM);
485 expected_platforms.insert(Feature::WIN_PLATFORM); 485 expected_platforms.insert(Feature::WIN_PLATFORM);
486 486
487 EXPECT_FALSE(feature->platforms()->empty()); 487 EXPECT_FALSE(feature->platforms()->empty());
488 EXPECT_EQ(expected_platforms, *feature->platforms()); 488 EXPECT_EQ(expected_platforms, *feature->platforms());
489 } 489 }
490 490
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 IsAvailableInChannel("trunk", VersionInfo::CHANNEL_CANARY)); 657 IsAvailableInChannel("trunk", VersionInfo::CHANNEL_CANARY));
658 EXPECT_EQ(Feature::UNSUPPORTED_CHANNEL, 658 EXPECT_EQ(Feature::UNSUPPORTED_CHANNEL,
659 IsAvailableInChannel("trunk", VersionInfo::CHANNEL_DEV)); 659 IsAvailableInChannel("trunk", VersionInfo::CHANNEL_DEV));
660 EXPECT_EQ(Feature::UNSUPPORTED_CHANNEL, 660 EXPECT_EQ(Feature::UNSUPPORTED_CHANNEL,
661 IsAvailableInChannel("trunk", VersionInfo::CHANNEL_BETA)); 661 IsAvailableInChannel("trunk", VersionInfo::CHANNEL_BETA));
662 EXPECT_EQ(Feature::UNSUPPORTED_CHANNEL, 662 EXPECT_EQ(Feature::UNSUPPORTED_CHANNEL,
663 IsAvailableInChannel("trunk", VersionInfo::CHANNEL_STABLE)); 663 IsAvailableInChannel("trunk", VersionInfo::CHANNEL_STABLE));
664 } 664 }
665 665
666 } // namespace 666 } // namespace
OLDNEW
« no previous file with comments | « chrome/common/extensions/features/simple_feature.cc ('k') | chrome/utility/networking_private_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698