msgbartop
Computer says no
msgbarbottom

04 Jun 09 Opera 10 Beta is out

Opera 10 Alpha last night prompted me to automatically update, and lo and behold it installed the Beta 1.

The most noticeable change is the default skin, which is lighter and more consistent, using some new etching effects and icons everywhere. More changes are on the horizon for this for Beta 2, from the skin designer John Hicks.

A cool new enhancement is you can drag down the tab bar to get thumbnails for all the tabs, known as Visual Tabs:

There’s now an interface to customize the Speed Dial (rather than manually editing ini files)

Opera Turbo, the Opera proxy service that offers compression of web pages (suitable for low-bandwidth connections) is built in and can be switched on or off or set to auto mode (turning itself on if it detects you’re on a slow internet connection). I have tested this out while I’m on 64kbps, and it’s ok but it’s probably not worth it unless Opera have some New Zealand or Australia proxies. I suspect it would work great in Europe.

Tags: , , , ,

03 Jun 09 Unit testing multi-threaded, asynchronous code and/or events

I’ve been writing some unit tests recently that test some multi-threaded functionality.

Typically this involves hooking up some event handlers then waiting for some asynchronous code to fire the event before proceeding with the unit test and assertions.

The ManualResetEvent class (MSDN) seems a good choice for this, and this post has a small example of using it in a unit test:


[Test()]
public void AfterRunAsync()
{
    ManualResetEvent manualEvent = new ManualResetEvent(false);

    TestTestCase tc = new TestTestCase(1, "", 0, 0);
    bool eventFired = false;
    tc.RunCompleted +=
        delegate(object sender, AsyncCompletedEventArgs e) {
            Assert.IsInstanceOfType(typeof (TestTestCase), sender, "sender is TestCase");
            bool passed = tc.Passed;
            string output = tc.Output;
            eventFired = true;
            manualEvent.Set();
        };
    tc.RunAsync();
    manualEvent.WaitOne(500, false);
    Assert.IsTrue(eventFired, "RunCompleted fired");
}

Tags: , , , , , , ,