Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: test/AppInfoJsObject.cpp

Issue 10807053: Add developmentBuild to AppInfo (Closed)
Patch Set: Created June 5, 2013, 9:18 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« include/AdblockPlus/AppInfo.h ('K') | « src/AppInfoJsObject.cpp ('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
1 /* 1 /*
2 * This file is part of Adblock Plus <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2013 Eyeo GmbH 3 * Copyright (C) 2006-2013 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details. 12 * GNU General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU General Public License 14 * You should have received a copy of the GNU General Public License
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
16 */ 16 */
17 17
18 #include <AdblockPlus.h> 18 #include <AdblockPlus.h>
19 #include <gtest/gtest.h> 19 #include <gtest/gtest.h>
20 20
21 TEST(AppInfoJsObjectTest, AllProperties) 21 TEST(AppInfoJsObjectTest, AllProperties)
22 { 22 {
23 AdblockPlus::AppInfo appInfo; 23 AdblockPlus::AppInfo appInfo;
24 appInfo.id = "1"; 24 appInfo.id = "1";
25 appInfo.version = "2"; 25 appInfo.version = "2";
26 appInfo.name = "4"; 26 appInfo.name = "4";
27 appInfo.platform = "5"; 27 appInfo.platform = "5";
28 appInfo.locale = "3"; 28 appInfo.locale = "3";
29 appInfo.developmentBuild = true;
29 AdblockPlus::JsEnginePtr jsEngine(AdblockPlus::JsEngine::New(appInfo)); 30 AdblockPlus::JsEnginePtr jsEngine(AdblockPlus::JsEngine::New(appInfo));
30 ASSERT_EQ("1", jsEngine->Evaluate("_appInfo.id")->AsString()); 31 ASSERT_EQ("1", jsEngine->Evaluate("_appInfo.id")->AsString());
31 ASSERT_EQ("2", jsEngine->Evaluate("_appInfo.version")->AsString()); 32 ASSERT_EQ("2", jsEngine->Evaluate("_appInfo.version")->AsString());
32 ASSERT_EQ("4", jsEngine->Evaluate("_appInfo.name")->AsString()); 33 ASSERT_EQ("4", jsEngine->Evaluate("_appInfo.name")->AsString());
33 ASSERT_EQ("5", jsEngine->Evaluate("_appInfo.platform")->AsString()); 34 ASSERT_EQ("5", jsEngine->Evaluate("_appInfo.platform")->AsString());
34 ASSERT_EQ("3", jsEngine->Evaluate("_appInfo.locale")->AsString()); 35 ASSERT_EQ("3", jsEngine->Evaluate("_appInfo.locale")->AsString());
36 ASSERT_TRUE(jsEngine->Evaluate("_appInfo.developmentBuild")->AsBool());
35 } 37 }
38
39 TEST(AppInfoJsObjectTest, DefaultPropertyValues)
40 {
41 AdblockPlus::AppInfo appInfo;
42 AdblockPlus::JsEnginePtr jsEngine(AdblockPlus::JsEngine::New(appInfo));
43 ASSERT_EQ("", jsEngine->Evaluate("_appInfo.id")->AsString());
44 ASSERT_EQ("", jsEngine->Evaluate("_appInfo.version")->AsString());
45 ASSERT_EQ("", jsEngine->Evaluate("_appInfo.name")->AsString());
46 ASSERT_EQ("", jsEngine->Evaluate("_appInfo.platform")->AsString());
47 ASSERT_EQ("", jsEngine->Evaluate("_appInfo.locale")->AsString());
48 ASSERT_FALSE(jsEngine->Evaluate("_appInfo.developmentBuild")->AsBool());
49 }
OLDNEW
« include/AdblockPlus/AppInfo.h ('K') | « src/AppInfoJsObject.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld