Skip to content

Commit

Permalink
fix: make android mocha tests run again (#14158)
Browse files Browse the repository at this point in the history
* fix: make android mocha tests run again

* fixing some tests

* Update tests/Resources/ti.ui.listview.test.js

* Update tests/Resources/ti.ui.listview.test.js

* revert code change
  • Loading branch information
m1ga authored Jan 28, 2025
1 parent 098f8c2 commit 1dd6438
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
7 changes: 5 additions & 2 deletions build/lib/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ async function addTiAppProperties() {
const tiapp_xml_string = await fs.readFile(tiapp_xml, 'utf8');
const content = [];
const insertManifest = () => {
content.push('\t\t\t<application android:theme="@style/Theme.Titanium.Dark">');
content.push('\t\t\t<application android:theme="@style/Theme.Titanium.Dark" android:icon="@mipmap/ic_launcher">');
content.push('\t\t\t\t<meta-data android:name="com.google.android.geo.API_KEY" android:value="AIzaSyCN_aC6RMaynan8YzsO1HNHbhsr9ZADDlY"/>');
content.push('\t\t\t\t<uses-library android:name="org.apache.http.legacy" android:required="false" />');
content.push(`\t\t\t\t<activity android:name=".${PROJECT_NAME.charAt(0).toUpperCase() + PROJECT_NAME.slice(1).toLowerCase()}Activity" android:exported="true">`);
Expand Down Expand Up @@ -291,7 +291,7 @@ async function addTiAppProperties() {
content.push('\t\t\t\t\t\t<key>UIApplicationShortcutItemType</key>');
content.push('\t\t\t\t\t\t<string>static_shortcut1</string>');
content.push('\t\t\t\t\t</dict>');
content.push('\t\t\t\t</array');
content.push('\t\t\t\t</array>');
};

// Not so smart but this should work...
Expand All @@ -300,6 +300,9 @@ async function addTiAppProperties() {
if (line.indexOf('\t<guid>') >= 0) {
line = '\t<guid>1c4b748c-7c16-4df1-bd5c-4ffe6240286e</guid>';
}
if (line.indexOf('<application android:icon="@mipmap/ic_launcher"/>') > 0) {
line = '';
}

content.push(line);
if (line.indexOf('<ios>') >= 0) {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions tests/Resources/ti.network.httpclient.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ describe('Titanium.Network.HTTPClient', function () {
}
};

xhr.open('GET', 'http://mockbin.org/redirect/301?to=https%3A%2F%2Fraw.githubusercontent.com%2Fappcelerator%2Ftitanium_mobile%2Fmaster%2Ftests%2FResources%2Flarge.jpg');
xhr.open('GET', 'https://httpbin.org/redirect-to?url=https%3A%2F%2Fraw.githubusercontent.com%2Ftidev%2Ftitanium-sdk%2Fmaster%2Ftests%2FResources%2Flarge.jpg');
xhr.send();
});

Expand Down Expand Up @@ -746,7 +746,7 @@ describe('Titanium.Network.HTTPClient', function () {
const html = e.source.responseText;
try {
// should(html).match(/id="protocol_tls1_3">(\s*<span\s+title="RFC 8446"\s*>\s*)?(<font color=green>)?Yes/);
should(html).match(/id="protocol_tls1_3">(<font color=green>)?Yes/);
should(html).match(/TLS 1.3/);
} catch (err) {
return finish(err);
}
Expand All @@ -755,7 +755,7 @@ describe('Titanium.Network.HTTPClient', function () {
onerror: _e => finish(new Error('Could not determine TLSv3 support.')),
timeout: 8000
});
client.open('GET', 'https://clienttest.ssllabs.com/ssltest/viewMyClient.html');
client.open('GET', 'https://www.howsmyssl.com/a/check');
client.send();
});

Expand Down

0 comments on commit 1dd6438

Please sign in to comment.