diff --git a/apps/api/documents/api.js b/apps/api/documents/api.js index 8876075ac..f41d99d47 100644 --- a/apps/api/documents/api.js +++ b/apps/api/documents/api.js @@ -838,9 +838,24 @@ return extensionParams["url"] + "apps/"; } + + function getTestPath() { + var scripts = document.getElementsByTagName('script'), + match; + + for (var i = scripts.length - 1; i >= 0; i--) { + match = scripts[i].src.match(/(.*)apps\/api\/documents\/api.js/i); + if (match) { + return match[1] + "test/apps/"; + } + } + + return ""; + } + function getAppPath(config) { var extensionPath = getExtensionPath(), - path = extensionPath ? extensionPath : getBasePath(), + path = extensionPath ? extensionPath : (config.type=="test" ? getTestPath() : getBasePath()), appMap = { 'text': 'documenteditor', 'text-pdf': 'documenteditor', diff --git a/test/apps/documenteditor/main/index.html b/test/apps/documenteditor/main/index.html new file mode 100644 index 000000000..15f14fe94 --- /dev/null +++ b/test/apps/documenteditor/main/index.html @@ -0,0 +1,8 @@ + + +
+ + + + + \ No newline at end of file diff --git a/test/apps/presentationeditor/main/index.html b/test/apps/presentationeditor/main/index.html new file mode 100644 index 000000000..15f14fe94 --- /dev/null +++ b/test/apps/presentationeditor/main/index.html @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/test/apps/spreadsheeteditor/main/index.html b/test/apps/spreadsheeteditor/main/index.html new file mode 100644 index 000000000..15f14fe94 --- /dev/null +++ b/test/apps/spreadsheeteditor/main/index.html @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/test/common.js b/test/unit-tests/common.js similarity index 100% rename from test/common.js rename to test/unit-tests/common.js diff --git a/test/common/index.html b/test/unit-tests/common/index.html similarity index 100% rename from test/common/index.html rename to test/unit-tests/common/index.html diff --git a/test/common/main/lib/component/Button.js b/test/unit-tests/common/main/lib/component/Button.js similarity index 100% rename from test/common/main/lib/component/Button.js rename to test/unit-tests/common/main/lib/component/Button.js diff --git a/test/common/main/lib/util/utils.js b/test/unit-tests/common/main/lib/util/utils.js similarity index 100% rename from test/common/main/lib/util/utils.js rename to test/unit-tests/common/main/lib/util/utils.js