I'm not familiar with the code either, but if people are fine making URLRequest::status() virtual, you can use gmock and be done. I have a hunch there might be some push back :)
If you're really interested in deterministic results, the longer way looks like you'd call RegisterRequestInterceptor() with a special URLRequestJob subclass that would modify a URLRequest instance to your liking. In fact url_request_test_job.h might be what you're looking for. Andrew On Fri, Sep 25, 2009 at 7:02 PM, Jenn Braithwaite (胡慧鋒) <[email protected]>wrote: > Hi, > I want my unittest to result in my URLRequest getting a non-success status. > How do I do that? > > When I use "http://localhost/foo" as my URL, I get a non-success status > with os_error = -102 when testing on Vista64, but I don't know if this will > guarantee me a non-success status all the time on all platforms. Is there a > more definitive technique to do what I want? > > Thanks, > Jenn > > > > --~--~---------~--~----~------------~-------~--~----~ Chromium Developers mailing list: [email protected] View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev -~----------~----~----~----~------~----~------~--~---
