• Eric Orth's avatar
    Improve overly helpful helper in DnsTransactionTest · 6baea144
    Eric Orth authored
    TransactionHelper was way too helpful, hiding away the actual
    transaction creation logic. Makes it too annoying to test additions or
    changes to the transaction creation logic, eg the new |fast_timeout|
    param, without adding more support to the helper.
    
    Fixes:
    *TransactionHelper::StartTransaction() now has an overload to allow
     passing in a transaction created by the individual test, rather than
     requiring that TransactionHelper always do the transaction creation.
    *TransactionHelper constructor params used for transaction creation now
     moved to the "old" StartTransaction(), so they are only necessary when
     the helper is doing the transaction creation.
    *Scaled back the Run...() helper methods that were themselves calling
     StartTransaction() and creating transactions. Now just a single
     RunUntilComplete() that runs an already created and started transaction
     until its completion callback gets called (same as the previous
     RunUntilDone() except it doesn't create and start the transaction).
     Does not return a bool indicating completion because it would always be
     true (and was uselessly always true for RunUntilDone()).
    
    Change-Id: I5e3a783730e4bd6d2362fcfc55ac4870e754d340
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2468463Reviewed-by: default avatarDan McArdle <dmcardle@chromium.org>
    Commit-Queue: Eric Orth <ericorth@chromium.org>
    Auto-Submit: Eric Orth <ericorth@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#817174}
    6baea144
dns_transaction_unittest.cc 146 KB