-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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 crashes with browser capabilities #758
Conversation
Please provide unit tests for this change. |
Hi, I think I've to load browscap.ini here
but i've no clue how. |
get { return capabilities; } | ||
set { capabilities = new Hashtable(value, StringComparer.OrdinalIgnoreCase); } | ||
set { | ||
Hashtable cap = new Hashtable (StringComparer.OrdinalIgnoreCase); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should specify the capacity parameter of the Hashtable constructor to avoid resize operations while adding keys, i.e. new Hashtable (value.Count, StringComparer.OrdinalIgnoreCase);
Before your change, this was done internally by the constructor that takes an IDictionary.
@akoeplinger, i've just updated my commit, thanks |
The tests in the class you mentioned seem to be ignored for many years (it says "Pending fix for bug 351878", which likely refers to this item in the old Novell Bugzilla). I think adding tests there wouldn't make sense now. Can someone from the Mono team comment if the original bug was fixed so the tests can be reenabled? |
A lot of time has passed since then, and the runtime has been receiving lots of fixes recently, there is a chance that this bug is fixed, and you can enable those tests now, just remove the [Ignore] attribute and check if they pass (run them many times just to make sure the bug doesn't appear in any case). |
After reenabeling in mcs/class/System.Web Excluded categories: NotWorking,ValueAdd,CAS,InetAccess Test Case Failures:
at NUnit.Framework.Assert.That (System.Object actual, NUnit.Framework.Constraints.Constraint constraint, System.String message, System.Object[] args) [0x00020] in /opt/echange/mono/mcs/nunit24/NUnitFramework/framework/Assert.cs:2205 With the patch all 5 tests are ok |
Some recommendations (briefly discussed already in IRC):
|
It's a WIP, make run-test PROFILE=net_2_0 ok |
I got 'Parent not found with id = default'
I think it's related to the lack of Compat.browser in NET_4_* |
Should that be fixed then? Maybe copy the Compat.browser file to all etc profile folders instead of just one, in the install make target? |
Tests for 2, 4, 4.5 are ok. |
Thanks for the update! I think it is fine that the file Compat.browser ends up triplicated in $prefix/etc, however I think it's not good to have it triplicated in the git repository, can you avoid this? In regards to "For the test case i simply reenable AppBrowsersTest.cs tests", do any of those tests have duplicate keys in browser capabilities? If not, then you're not really adding a test for this bugfix (as Rodrigo has requested), but restoring old tests unrelated to this issue. |
The test CompatBrowserIE7 is failing because of Key duplication |
Ah ok! |
Tests still ok, rpm creation should be ok (just modified mono-core.spec.in to include Compat.browser, also msvc/win32.xml for win*) |
Instead of
this would be shorter (and would make the last duplicated value the one to use, instead of the first one):
Right? |
Correct https://bugzilla.xamarin.com/show_bug.cgi?id=14720 and probably https://bugzilla.xamarin.com/show_bug.cgi?id=13014 Signed-off-by: Etienne CHAMPETIER <etienne.champetier@fiducial.net> Signed-off-by: Frederic Mestayer <f.mestayer@fiducial.net>
Without that referencing browser 'Default' (parentID="Default") in a .browser file make the app throw exceptions here mcs/class/System.Web/System.Web.Configuration_2.0/nBrowser/Build.cs#L206 Signed-off-by: Etienne CHAMPETIER <etienne.champetier@fiducial.net>
For now mcs/class/System.Web/Test/mainsoft/NunitWebResources/adapters.browser depends on System.Web_test_net_2_0.dll Signed-off-by: Etienne CHAMPETIER <etienne.champetier@fiducial.net>
Fix crashes with browser capabilities
Fix crashes with browser capabilities Commit migrated from mono/mono@bdc4eb0
Correct https://bugzilla.xamarin.com/show_bug.cgi?id=14720 and
probably https://bugzilla.xamarin.com/show_bug.cgi?id=13014
Signed-off-by: Etienne CHAMPETIER etienne.champetier@fiducial.net
Signed-off-by: Frederic Mestayer f.mestayer@fiducial.net
in mcs/class/System.Web
make run-test PROFILE=net_2_0 ok
make run-test PROFILE=net_4_0 ok
make run-test PROFILE=net_4_5 ok
make run-test PROFILE=net_3_5 doesn't run at all on my system