Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 652f72c

Browse files
author
Miroslava Ivanova
committedApr 19, 2018
check for dex files
1 parent 4a7cd16 commit 652f72c

File tree

5 files changed

+119
-1
lines changed

5 files changed

+119
-1
lines changed
 
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
In NativeScript, the app.js file is the entry point to your application.
3+
You can use this file to perform app-level initialization, but the primary
4+
purpose of the file is to pass control to the app’s first module.
5+
*/
6+
7+
require("./bundle-config");
8+
var application = require("application");
9+
var extendedClassesSpaces = require("./extended-classes spaces");
10+
var extendedClassesDashes = require("./extended-classes-dashes");
11+
var extendedClassesInDirWithSpaces = require("./dir spaces/extended-classes");
12+
13+
var i1 = extendedClassesSpaces.getExtendedClassInstance();
14+
var i2 = extendedClassesDashes.getExtendedClassInstance();
15+
var i3 = extendedClassesInDirWithSpaces.getExtendedClassInstance();
16+
17+
application.start({ moduleName: "main-page" });
18+
19+
/*
20+
Do not place any code after the application has been started as it will not
21+
be executed on iOS.
22+
*/
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
function getExtendedClasses() {
2+
var ExtendedClass = java.lang.Object.extend({
3+
4+
});
5+
6+
return {
7+
ExtendedClass
8+
};
9+
}
10+
11+
function getExtendedClassInstance() {
12+
var Clazz = getExtendedClasses().ExtendedClass;
13+
var instance;
14+
15+
instance = new Clazz();
16+
17+
return instance;
18+
}
19+
20+
module.exports = {
21+
getExtendedClasses,
22+
getExtendedClassInstance
23+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
function getExtendedClasses() {
2+
var ExtendedClass = java.lang.Object.extend({
3+
4+
});
5+
6+
return {
7+
ExtendedClass
8+
};
9+
}
10+
11+
function getExtendedClassInstance() {
12+
var Clazz = getExtendedClasses().ExtendedClass;
13+
var instance;
14+
15+
instance = new Clazz();
16+
17+
return instance;
18+
}
19+
20+
module.exports = {
21+
getExtendedClasses,
22+
getExtendedClassInstance
23+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
function getExtendedClasses() {
2+
var ExtendedClass = android.view.View.MeasureSpec.extend({
3+
4+
});
5+
6+
return {
7+
ExtendedClass
8+
};
9+
}
10+
11+
function getExtendedClassInstance() {
12+
var Clazz = getExtendedClasses().ExtendedClass;
13+
var instance;
14+
15+
instance = new Clazz();
16+
17+
return instance;
18+
}
19+
20+
module.exports = {
21+
getExtendedClasses,
22+
getExtendedClassInstance
23+
}

‎tests/emulator/run_android_ng_tests.py

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@
1010
from core.base_class.BaseClass import BaseClass
1111
from core.device.device import Device
1212
from core.device.emulator import Emulator
13+
from core.osutils.command_log_level import CommandLogLevel
1314
from core.osutils.file import File
1415
from core.osutils.folder import Folder
1516
from core.osutils.os_type import OSType
16-
from core.settings.settings import ANDROID_PACKAGE, EMULATOR_ID, EMULATOR_NAME, CURRENT_OS
17+
from core.settings.settings import ANDROID_PACKAGE, EMULATOR_ID, EMULATOR_NAME, CURRENT_OS, TEST_RUN_HOME
1718
from core.tns.replace_helper import ReplaceHelper
1819
from core.tns.tns import Tns
1920
from core.tns.tns_platform_type import Platform
21+
from core.device.helpers.adb import Adb
2022

2123

2224
class RunAndroidEmulatorTestsNG(BaseClass):
@@ -210,3 +212,28 @@ def test_280_tns_run_android_console_time(self):
210212
# Verify console.time() works
211213
console_time = ['JS: startup:']
212214
Tns.wait_for_log(log_file=log, string_list=console_time)
215+
216+
217+
def test_420_check_dex_files_on_device(self):
218+
"""
219+
check for files on device - shouldn't have *.dex
220+
"""
221+
Tns.platform_remove(platform=Platform.ANDROID, attributes={"--path": self.app_name},
222+
assert_success=False)
223+
File.remove(self.app_name + "/app/app.js")
224+
Folder.copy(TEST_RUN_HOME + "/data/issues/android-runtime-pr-923/app.js", TEST_RUN_HOME + "/TestApp/app/")
225+
Folder.create(self.app_name + "/app/" + "dir spaces")
226+
227+
Folder.copy(TEST_RUN_HOME + "/data/issues/android-runtime-pr-923/dir spaces/extended-classes.js",
228+
TEST_RUN_HOME + "/TestApp/app/dir spaces")
229+
Folder.copy(TEST_RUN_HOME + "/data/issues/android-runtime-pr-923/extended-classes spaces.js",
230+
TEST_RUN_HOME + "/TestApp/app")
231+
Folder.copy(TEST_RUN_HOME + "/data/issues/android-runtime-pr-923/extended-classes-dashes.js",
232+
TEST_RUN_HOME + "/TestApp/app")
233+
234+
Tns.run_android(attributes={'--path': self.app_name, '--device': EMULATOR_ID, '--justlaunch': ''})
235+
# command = "shell ls /data/data/org.nativescript.TestApp/code_cache/secondary-dexes | grep '\.dex'"
236+
command = "shell ls /data/data/org.nativescript.TestApp/code_cache/secondary-dexes"
237+
output = Adb.run(device_id=EMULATOR_ID, command=command, log_level=CommandLogLevel.FULL)
238+
print output
239+
assert "dex" in output

0 commit comments

Comments
 (0)
Please sign in to comment.