Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make android mocha tests run again #14158

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,10 @@ public int getLineCount()
public String getVisibleText()
{
MaterialTextView textView = (MaterialTextView) getNativeView();
return textView.getLayout().getText().toString();
if (textView != null && textView.getLayout() != null) {
return textView.getLayout().getText().toString();
} else {
return "";
}
}
}
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
Loading