Pawel's suggestion is a good way. We already do this in the existing test suites (for example, search for RuleBasedHostResolverProc in http://src.chromium.org/viewvc/chrome/trunk/src/chrome/test/in_process_browser_test.cc)
So you should be able to just call methods on RuleBasedHostResolverProc (see src/net/base/mock_host_resolver.h): AddRuleWithLatency(host_pattern, replacement, latency) AllowDirectLookup(host) AddSimulatedFailure(host) AddIPv6Rule(host, ipv6_literal) On Wed, Sep 16, 2009 at 11:21 AM, Paweł Hajdan Jr. <[email protected]> wrote: > You can mock the HostResolver to make it fail to resolve anything (possibly > except localhost). For examples, see HostResolver's unit tests and possibly > other places where it is used. > You can also make it fail to resolve specific hosts, which should also be > handy. > > On Tue, Sep 15, 2009 at 13:54, TJ Shah <[email protected]> wrote: >> >> Hi, >> >> I am trying to automate few test cases that requires me to simulate >> certain scenarios like 'Network is down' or 'Sync server not >> reachable' etc.. I am not sure about the Chrome Library that I can use >> to play with Windows Network Settings. I am using InProcBrowser Test. >> >> Pointers to library or examples will be helpful... >> >> -- >> Thanks, >> >> Tejas >> >> > > > > > --~--~---------~--~----~------------~-------~--~----~ Chromium Developers mailing list: [email protected] View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev -~----------~----~----~----~------~----~------~--~---
