-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[7_0_X][TIMOB-20332] Android: Closing a Ti.UI.TabGroup that contains …
…a ti.map view crashes the app (#9678) * Fix FragmentManager reference when TiUIFragment is in TabGroup. * Add unit test. * Try to fix test
- Loading branch information
1 parent
b13a1d2
commit 64afb38
Showing
2 changed files
with
57 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* Appcelerator Titanium Mobile | ||
* Copyright (c) 2011-Present by Appcelerator, Inc. All Rights Reserved. | ||
* Licensed under the terms of the Apache Public License | ||
* Please see the LICENSE included with this distribution for details. | ||
*/ | ||
/* eslint-env mocha */ | ||
/* global Ti */ | ||
/* eslint no-unused-expressions: "off" */ | ||
'use strict'; | ||
var should = require('./utilities/assertions'); | ||
|
||
describe('Titanium.UI.Tabgroup', function () { | ||
var tabGroup, | ||
tab; | ||
|
||
afterEach(function () { | ||
if (tab && tabGroup) { | ||
tabGroup.removeTab(tab); | ||
} | ||
tab = null; | ||
}); | ||
|
||
it('Remove MapView from TabGroup', function (finish) { | ||
// create tab group | ||
var win = Ti.UI.createWindow({ | ||
title:'Tab 1', | ||
backgroundColor:'#fff' | ||
}), | ||
Map = require('ti.map'), | ||
mapview; | ||
|
||
this.timeout(10000); | ||
|
||
tabGroup = Ti.UI.createTabGroup(); | ||
tab = Ti.UI.createTab({ | ||
title:'Tab 1', | ||
window: win | ||
}); | ||
|
||
mapview = Map.createView({ top: 0, height: '80%' }); | ||
// when the map is done loading, close the tab group | ||
mapview.addEventListener('complete', function () { | ||
tabGroup.close(); | ||
}); | ||
|
||
win.add(mapview); | ||
tabGroup.addTab(tab); | ||
tabGroup.open(); | ||
|
||
// when the tab group is closed, finish the test | ||
tabGroup.addEventListener('close', function () { | ||
finish(); | ||
}); | ||
}); | ||
}); |