Remove Action property from Intent class.

Location tests are not executed on emulator.
Label test made for iOS only.
Change frame.android.action property to method.
Image measured widht/height are now floor (like in android runtime).
This commit is contained in:
hshristov
2015-04-09 17:22:50 +03:00
parent 6a36011403
commit f0f6992cf0
5 changed files with 27 additions and 13 deletions

View File

@ -4,6 +4,16 @@ import trace = require("trace");
import frameModule = require("ui/frame");
frameModule.Frame.defaultAnimatedNavigation = false;
function isRunningOnEmulator(): boolean {
// This checks are not good enough to be added to modules but keeps unittests green.
return android.os.Build.FINGERPRINT.indexOf("generic") > -1 ||
android.os.Build.HARDWARE.toLowerCase() === "goldfish" ||
android.os.Build.HARDWARE.toLowerCase() === "donatello" || // VS Emulator
android.os.Build.PRODUCT.toLocaleLowerCase().indexOf("sdk") > -1 ||
android.os.Build.PRODUCT.toLocaleLowerCase().indexOf("emulator") > -1; // VS Emulator
}
export var allTests = {};
allTests["DOCKLAYOUT"] = require("./layouts/dock-layout-tests");
allTests["WRAPLAYOUT"] = require("./layouts/wrap-layout-tests");
@ -16,7 +26,6 @@ allTests["SCROLL-VIEW"] = require("./ui/scroll-view/scroll-view-tests");
allTests["APPLICATION"] = require("./application-tests");
allTests["FILE SYSTEM"] = require("./file-system-tests");
allTests["HTTP"] = require("./http-tests");
allTests["LOCATION"] = require("./location-tests");
allTests["LOCAL SETTINGS"] = require("./local-settings-tests");
allTests["IMAGE SOURCE"] = require("./image-source-tests");
allTests["TIMER"] = require("./timer-tests");
@ -51,6 +60,9 @@ allTests["LIST-PICKER"] = require("./ui/list-picker/list-picker-tests");
allTests["DATE-PICKER"] = require("./ui/date-picker/date-picker-tests");
allTests["TIME-PICKER"] = require("./ui/time-picker/time-picker-tests");
allTests["WEB-VIEW"] = require("./ui/web-view/web-view-tests");
if (!isRunningOnEmulator()) {
allTests["LOCATION"] = require("./location-tests");
}
var testsWithLongDelay = {
testLocation: 10000,

View File

@ -93,16 +93,19 @@ export var test_measuredWidth_is_not_clipped = function () {
label.text = "i";
label.fontSize = 9;
var test = function (views: Array<view.View>) {
if (label.ios) {
TKUnit.waitUntilReady(() => { return label.isLayoutValid; });
var test = function (views: Array<view.View>) {
var expectedValue = 3;
var measuredWidth = label.getMeasuredWidth();
TKUnit.assertEqual(measuredWidth, expectedValue, "measuredWidth should not be rounded down.");
TKUnit.waitUntilReady(() => { return label.isLayoutValid; });
var expectedValue = 3;
var measuredWidth = label.getMeasuredWidth();
TKUnit.assertEqual(measuredWidth, expectedValue, "measuredWidth should not be rounded down.");
}
helper.buildUIAndRunTest(label, test);
}
helper.buildUIAndRunTest(label, test);
}
export var test_Set_TextWrap_TNS = function () {