diff --git a/apps/.vscode/settings.json b/apps/.vscode/settings.json index c7c1623bc..4367a83fc 100644 --- a/apps/.vscode/settings.json +++ b/apps/.vscode/settings.json @@ -1,3 +1,3 @@ { - "typescript.tsdk": "./node_modules/typescript/lib" + } \ No newline at end of file diff --git a/apps/app/ui-tests-app/pages/console.ts b/apps/app/ui-tests-app/pages/console.ts index 05aecdb72..e691adfab 100644 --- a/apps/app/ui-tests-app/pages/console.ts +++ b/apps/app/ui-tests-app/pages/console.ts @@ -61,16 +61,16 @@ export function pageLoaded() { console.assert(true, "1 equals 1"); if (app.android) { - console.dump(true); - console.dump(false); - console.dump(null); - console.dump(undef); + console.dir(true); + console.dir(false); + console.dir(null); + console.dir(undef); - console.dump(num); - console.dump(str); + console.dir(num); + console.dir(str); console.dir(obj); - console.dump(foo); + console.dir(foo); console.log("%j", button); } diff --git a/apps/tsconfig.json b/apps/tsconfig.json index c06a3a67e..8c440e6af 100644 --- a/apps/tsconfig.json +++ b/apps/tsconfig.json @@ -4,4 +4,4 @@ "node_modules", "platforms" ] -} \ No newline at end of file +} diff --git a/package.json b/package.json index 90b06fa63..e890298b0 100644 --- a/package.json +++ b/package.json @@ -49,8 +49,8 @@ "dev-declarations": "npm run setup && rm -rf tns-platform-declarations/ios/objc* && TNS_TYPESCRIPT_DECLARATIONS_PATH=$PWD/tns-platform-declarations/ios/objc tns build ios --path tests", "test": "npm run test-android && npm run test-ios", "pretest": "npm run setup && npm run tsc", - "test-android": "tns run android --path tests --justlaunch", - "test-ios": "tns run ios --path tests --justlaunch", + "test-android": "tns run android --path tests --justlaunch --no-watch", + "test-ios": "tns run ios --path tests --justlaunch --no-watch", "test-watch-android": "npm run pretest && concurrently --kill-others \"npm run tsc-tiw\" \"tns livesync android --path tests --watch\"", "test-watch-ios": "npm run pretest && concurrently --kill-others \"npm run tsc-tiw\" \"tns livesync ios --path tests --watch\"", "prepublish": "echo \"Development reminder: npm run setup\n\"", diff --git a/tests/.vscode/launch.json b/tests/.vscode/launch.json index abcaa7450..f0ef4397b 100644 --- a/tests/.vscode/launch.json +++ b/tests/.vscode/launch.json @@ -8,7 +8,8 @@ "platform": "ios", "appRoot": "${workspaceRoot}", "sourceMaps": true, - "watch": true + "watch": true, + "stopOnEntry": true }, { "name": "Attach on iOS", @@ -26,7 +27,8 @@ "platform": "android", "appRoot": "${workspaceRoot}", "sourceMaps": true, - "watch": true + "watch": true, + "stopOnEntry": true }, { "name": "Attach on Android", diff --git a/tests/app/app/location-example.ts b/tests/app/app/location-example.ts deleted file mode 100644 index 5cbd92b5e..000000000 --- a/tests/app/app/location-example.ts +++ /dev/null @@ -1,69 +0,0 @@ -import * as pages from "ui/page"; -import * as locationModule from "location"; -import * as dialogsModule from "ui/dialogs"; -import * as platformModule from "platform"; -import * as textViewModule from "ui/text-view"; -import * as observable from "data/observable"; -import * as appModule from "application"; - -var locationManager = new locationModule.LocationManager(); - -export function onStartButtonTap(args: observable.EventData) { - console.log("Start button tapped"); - var textView = (page.getViewById("textView")); - locationManager.startLocationMonitoring(function (location) { - console.log("location-example.location: " + printLocation(location)); - textView.text = printLocation(location) + "\r\n" + textView.text; - }, null, { desiredAccuracy: 300, maximumAge: 20000, minimumUpdateTime: 5000, updateDistance: 20 }); -} - -function printLocation(location: locationModule.Location) { - return "longitude: " + location.longitude + ", " + - "latitude: " + location.latitude + ", " + - "timeStamp: " + location.timestamp + ", " + - "horizontalAccuracy: " + location.horizontalAccuracy + ", " + - "verticalAccuracy: " + location.verticalAccuracy; -} - -export function onStopButtonTap(args: observable.EventData) { - locationManager.stopLocationMonitoring(); -} - -export function onRequestButtonTap(args: observable.EventData) { - checkLocationService(page); -} - -var page: pages.Page; - -export function pageLoaded(args: observable.EventData) { - page = (args.object); -} - -var checkLocationService = function (page: pages.Page) { - if (locationModule.LocationManager.isEnabled()) { - console.log("LocationManager.isEnabled"); - } - else { - console.log("LocationManager.is not Enabled"); - if (page.android) { - dialogsModule.confirm({ - message: "Location service is not enabled!", - okButtonText: "Open location settings ...", - cancelButtonText: "Cancel", title: "Confirm" - }).then((r) => { - if (r) { - // do not forget to add android.permission.ACCESS_FINE_LOCATION in your manifest file - (appModule.android.currentContext).startActivityForResult(new android.content.Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS), 0); - } - }, null); - } - else if (page.ios) { - if (platformModule.device.osVersion.indexOf("8") === 0) { - // we need special handling of iOS 8.0 version, since some breaking changes regarding location - // do not forget to put NSLocationWhenInUseUsageDescription in app.plist file - var iosLocationManager = CLLocationManager.alloc().init(); - iosLocationManager.requestWhenInUseAuthorization(); - } - } - } -} \ No newline at end of file diff --git a/tests/app/app/location-example.xml b/tests/app/app/location-example.xml deleted file mode 100644 index ab17efc7d..000000000 --- a/tests/app/app/location-example.xml +++ /dev/null @@ -1,8 +0,0 @@ - - -