Home | History | Annotate | Download | only in http

Lines Matching refs:transaction

942 // Tests that disk failures after the transaction has started don't cause the
1004 // force this transaction to read from the cache
1005 MockTransaction transaction(kSimpleGET_Transaction);
1006 transaction.load_flags |= net::LOAD_ONLY_FROM_CACHE;
1010 RunTransactionTestWithLog(cache.http_cache(), transaction, log);
1035 // force this transaction to read from the cache
1036 MockTransaction transaction(kSimpleGET_Transaction);
1037 transaction.load_flags |= net::LOAD_ONLY_FROM_CACHE;
1039 MockHttpRequest request(transaction);
1065 // force this transaction to read from the cache if valid
1066 MockTransaction transaction(kSimpleGET_Transaction);
1067 transaction.load_flags |= net::LOAD_PREFERRING_CACHE;
1069 RunTransactionTest(cache.http_cache(), transaction);
1079 // force this transaction to read from the cache if valid
1080 MockTransaction transaction(kSimpleGET_Transaction);
1081 transaction.load_flags |= net::LOAD_PREFERRING_CACHE;
1083 RunTransactionTest(cache.http_cache(), transaction);
1096 // force this transaction to write to the cache again
1097 MockTransaction transaction(kSimpleGET_Transaction);
1098 transaction.load_flags |= net::LOAD_BYPASS_CACHE;
1100 RunTransactionTest(cache.http_cache(), transaction);
1113 // force this transaction to write to the cache again
1114 MockTransaction transaction(kSimpleGET_Transaction);
1115 transaction.request_headers = "pragma: no-cache";
1117 RunTransactionTest(cache.http_cache(), transaction);
1130 // force this transaction to write to the cache again
1131 MockTransaction transaction(kSimpleGET_Transaction);
1132 transaction.request_headers = "cache-control: no-cache";
1134 RunTransactionTest(cache.http_cache(), transaction);
1150 // force this transaction to validate the cache
1151 MockTransaction transaction(kSimpleGET_Transaction);
1152 transaction.load_flags |= net::LOAD_VALIDATE_CACHE;
1154 RunTransactionTest(cache.http_cache(), transaction);
1170 // force this transaction to validate the cache
1171 MockTransaction transaction(kSimpleGET_Transaction);
1172 transaction.request_headers = "cache-control: max-age=0";
1174 RunTransactionTest(cache.http_cache(), transaction);
1193 MockTransaction transaction(kSimpleGET_Transaction);
1194 transaction.handler = PreserveRequestHeaders_Handler;
1195 transaction.request_headers = EXTRA_HEADER;
1196 transaction.response_headers = "Cache-Control: max-age=0\n";
1197 AddMockTransaction(&transaction);
1200 RunTransactionTest(cache.http_cache(), transaction);
1201 RunTransactionTest(cache.http_cache(), transaction);
1206 RemoveMockTransaction(&transaction);
1216 MockTransaction transaction(kETagGET_Transaction);
1217 transaction.handler = PreserveRequestHeaders_Handler;
1218 transaction.request_headers = "If-None-Match: \"foopy\"\n"
1220 AddMockTransaction(&transaction);
1222 RunTransactionTest(cache.http_cache(), transaction);
1227 RemoveMockTransaction(&transaction);
1329 // the queue to move to the next transaction. Now we cancel the request that
1391 // Cancel the first queued transaction.
1407 // transaction to said entry.
1489 // Destroy only the first transaction.
1636 // Test that destroying the transaction while it is reading from the cache
1641 // HttpCache::Transaction::OnCacheReadCompleted.
1679 ScopedMockTransaction transaction(kETagGET_Transaction);
1682 RunTransactionTest(cache.http_cache(), transaction);
1690 transaction.load_flags = net::LOAD_VALIDATE_CACHE;
1691 transaction.handler = ETagGet_ConditionalRequest_Handler;
1692 RunTransactionTest(cache.http_cache(), transaction);
1714 ScopedMockTransaction transaction(kETagGET_Transaction);
1717 RunTransactionTest(cache.http_cache(), transaction);
1725 transaction.load_flags = net::LOAD_VALIDATE_CACHE;
1726 transaction.handler = ETagGet_ConditionalRequest_NoStore_Handler;
1727 RunTransactionTest(cache.http_cache(), transaction);
2247 MockTransaction transaction(kSimplePOST_Transaction);
2248 transaction.load_flags |= net::LOAD_ONLY_FROM_CACHE;
2250 MockHttpRequest request(transaction);
2275 MockTransaction transaction(kSimplePOST_Transaction);
2279 MockHttpRequest request(transaction);
2285 RunTransactionTestWithRequest(cache.http_cache(), transaction, request, NULL);
2293 RunTransactionTestWithRequest(cache.http_cache(), transaction, request, NULL);
2313 MockTransaction transaction(kSimpleGET_Transaction);
2314 transaction.request_headers = "If-None-Match: foo";
2315 RunTransactionTest(cache.http_cache(), transaction);
2321 transaction.request_headers =
2323 RunTransactionTest(cache.http_cache(), transaction);
2336 MockTransaction transaction(kRangeGET_Transaction);
2337 transaction.request_headers = "If-None-Match: foo\n"
2340 RunTransactionTest(cache.http_cache(), transaction);
2346 transaction.request_headers =
2350 RunTransactionTest(cache.http_cache(), transaction);
2356 transaction.request_headers = "If-Range: bla\n"
2359 RunTransactionTest(cache.http_cache(), transaction);
2372 MockTransaction transaction(kRangeGET_TransactionOK);
2373 AddMockTransaction(&transaction);
2374 transaction.request_headers = EXTRA_HEADER;
2375 transaction.handler = NULL;
2376 RunTransactionTest(cache.http_cache(), transaction);
2383 RunTransactionTest(cache.http_cache(), transaction);
2388 RemoveMockTransaction(&transaction);
2417 // Make sure we are done with the previous transaction.
2421 MockTransaction transaction(kRangeGET_TransactionOK);
2422 transaction.request_headers = "Range: bytes = 30-39\r\n" EXTRA_HEADER;
2423 transaction.data = "rg: 30-39 ";
2424 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
2431 // Make sure we are done with the previous transaction.
2435 transaction.request_headers = "Range: bytes = 20-59\r\n" EXTRA_HEADER;
2436 transaction.data = "rg: 20-29 rg: 30-39 rg: 40-49 rg: 50-59 ";
2437 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
2453 MockTransaction transaction(kRangeGET_TransactionOK);
2454 transaction.test_mode = TEST_MODE_SYNC_ALL;
2455 AddMockTransaction(&transaction);
2459 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
2467 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
2474 // Make sure we are done with the previous transaction.
2478 transaction.request_headers = "Range: bytes = 30-39\r\n" EXTRA_HEADER;
2479 transaction.data = "rg: 30-39 ";
2480 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
2487 // Make sure we are done with the previous transaction.
2491 transaction.request_headers = "Range: bytes = 20-59\r\n" EXTRA_HEADER;
2492 transaction.data = "rg: 20-29 rg: 30-39 rg: 40-49 rg: 50-59 ";
2493 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
2500 RemoveMockTransaction(&transaction);
2578 MockTransaction transaction(kRangeGET_TransactionOK);
2579 transaction.request_headers = "Range: bytes = -10\r\n" EXTRA_HEADER;
2580 transaction.data = "rg: 70-79 ";
2581 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
2588 // Make sure we are done with the previous transaction.
2592 transaction.request_headers = "Range: bytes = 60-\r\n" EXTRA_HEADER;
2593 transaction.data = "rg: 60-69 rg: 70-79 ";
2594 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
2612 MockTransaction transaction(kRangeGET_TransactionOK);
2613 transaction.test_mode = TEST_MODE_SYNC_CACHE_START |
2616 AddMockTransaction(&transaction);
2619 transaction.request_headers = "Range: bytes = 70-\r\n" EXTRA_HEADER;
2620 transaction.data = "rg: 70-79 ";
2621 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
2628 // Make sure we are done with the previous transaction.
2632 transaction.request_headers = "Range: bytes = -20\r\n" EXTRA_HEADER;
2633 transaction.data = "rg: 60-69 rg: 70-79 ";
2634 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
2641 RemoveMockTransaction(&transaction);
2651 MockTransaction transaction(kRangeGET_TransactionOK);
2652 AddMockTransaction(&transaction);
2658 transaction.request_headers = "Range: bytes = 70-\r\n" EXTRA_HEADER;
2659 transaction.data = "rg: 70-79 ";
2660 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
2668 RunTransactionTest(cache.http_cache(), transaction);
2671 RemoveMockTransaction(&transaction);
2691 MockTransaction transaction(kRangeGET_TransactionOK);
2692 transaction.request_headers = EXTRA_HEADER;
2693 transaction.data = "rg: 00-09 rg: 10-19 rg: 20-29 rg: 30-39 rg: 40-49 "
2695 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
2711 MockTransaction transaction(kRangeGET_TransactionOK);
2712 transaction.request_headers = "Range: bytes = 0-9\r\n" EXTRA_HEADER;
2713 transaction.data = "rg: 00-09 ";
2714 AddMockTransaction(&transaction);
2718 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
2737 RemoveMockTransaction(&transaction);
2749 MockTransaction transaction(kRangeGET_TransactionOK);
2750 transaction.request_headers = "Range: bytes = 0-9\r\n" EXTRA_HEADER;
2751 transaction.data = "rg: 00-09 ";
2752 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
2776 RunTransactionTest(cache.http_cache(), transaction);
2779 RemoveMockTransaction(&transaction);
2872 MockTransaction transaction(kTypicalGET_Transaction);
2873 transaction.url = kRangeGET_TransactionOK.url;
2874 transaction.data = "rg: 00-09 rg: 10-19 rg: 20-29 rg: 30-39 rg: 40-49 "
2876 AddMockTransaction(&transaction);
2877 RunTransactionTest(cache.http_cache(), transaction);
2882 RemoveMockTransaction(&transaction);
2898 // The last transaction has finished so make sure the entry is deactivated.
2924 MockTransaction transaction(kRangeGET_TransactionOK);
2925 transaction.request_headers = "Range: bytes = -10\r\n" EXTRA_HEADER;
2926 transaction.data = "rg: 70-79 ";
2927 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
2974 MockTransaction transaction(kRangeGET_TransactionOK);
2975 transaction.request_headers = "Range: bytes = 120-\r\n" EXTRA_HEADER;
2976 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
3017 // Destroy the transaction.
3058 // Destroy the transaction before completing the read.
3062 // message loop. This means that a new transaction will just reuse the same
3103 // Destroy the transaction before completing the read.
3107 // message loop. This means that a new transaction will just reuse the same
3121 // The new transaction is waiting for the query range callback.
3139 MockTransaction transaction(kRangeGET_TransactionOK);
3140 transaction.handler = NULL;
3141 transaction.response_headers = "Content-Range: bytes 40-49/45\n"
3143 AddMockTransaction(&transaction);
3144 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
3146 std::string expected(transaction.status);
3148 expected.append(transaction.response_headers);
3169 MockTransaction transaction(kRangeGET_TransactionOK);
3170 transaction.handler = NULL;
3171 transaction.response_headers = "Content-Range: bytes 40-49/80\n"
3173 AddMockTransaction(&transaction);
3174 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
3176 std::string expected(transaction.status);
3178 expected.append(transaction.response_headers);
3200 MockTransaction transaction(kRangeGET_TransactionOK);
3201 transaction.handler = NULL;
3202 transaction.request_headers = "Range: bytes = 50-59\r\n" EXTRA_HEADER;
3203 std::string response_headers(transaction.response_headers);
3205 transaction.response_headers = response_headers.c_str();
3206 AddMockTransaction(&transaction);
3207 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
3214 RemoveMockTransaction(&transaction);
3217 // This transaction will report a resource size of 80 bytes, and we think it's
3248 MockTransaction transaction(kRangeGET_TransactionOK);
3249 transaction.handler = NULL;
3250 transaction.request_headers = "Range: bytes = 4294967288-4294967297\r\n"
3252 transaction.response_headers =
3255 AddMockTransaction(&transaction);
3256 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
3258 std::string expected(transaction.status);
3260 expected.append(transaction.response_headers);
3292 MockTransaction transaction(kRangeGET_TransactionOK);
3293 transaction.request_headers = "Range: bytes = -10\r\n" EXTRA_HEADER;
3294 transaction.method = "HEAD";
3295 transaction.data = "rg: 70-79 ";
3298 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
3314 MockTransaction transaction(kRangeGET_TransactionOK);
3315 transaction.request_headers = "Range: bytes = 40-\r\n" EXTRA_HEADER;
3316 transaction.test_mode = TEST_MODE_SYNC_NET_START;
3317 AddMockTransaction(&transaction);
3325 RunTransactionTest(cache.http_cache(), transaction);
3331 RemoveMockTransaction(&transaction);
3341 MockTransaction transaction(kRangeGET_TransactionOK);
3342 transaction.request_headers = "Range: bytes = 40-49\r\n" EXTRA_HEADER;
3343 transaction.data = "rg: 40-"; // Less than expected.
3344 transaction.handler = NULL;
3345 std::string headers(transaction.response_headers);
3347 transaction.response_headers = headers.c_str();
3349 AddMockTransaction(&transaction);
3352 RunTransactionTest(cache.http_cache(), transaction);
3360 transaction.request_headers = "Range: bytes = 60-69\r\n" EXTRA_HEADER;
3361 transaction.data = "rg: 60-"; // Less than expected.
3364 transaction.response_headers = headers.c_str();
3366 RunTransactionTest(cache.http_cache(), transaction);
3372 RemoveMockTransaction(&transaction);
3388 // Force this transaction to read from the cache.
3389 MockTransaction transaction(kRangeGET_TransactionOK);
3390 transaction.load_flags |= net::LOAD_ONLY_FROM_CACHE;
3392 MockHttpRequest request(transaction);
3461 // Destroy the transaction. We only have the headers so we should delete this
3499 // Destroy the transaction.
3515 MockTransaction transaction(kSimpleGET_Transaction);
3516 transaction.response_headers =
3521 AddMockTransaction(&transaction);
3522 MockHttpRequest request(transaction);
3543 // Destroy the transaction.
3552 RemoveMockTransaction(&transaction);
3560 MockTransaction transaction(kSimpleGET_Transaction);
3561 transaction.response_headers =
3565 AddMockTransaction(&transaction);
3566 MockHttpRequest request(transaction);
3587 // Destroy the transaction.
3600 RemoveMockTransaction(&transaction);
3635 MockTransaction transaction(kRangeGET_TransactionOK);
3636 transaction.request_headers = EXTRA_HEADER;
3637 transaction.data = "rg: 00-09 rg: 10-19 rg: 20-29 rg: 30-39 rg: 40-49 "
3639 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
3699 MockTransaction transaction(kRangeGET_TransactionOK);
3700 transaction.request_headers = EXTRA_HEADER;
3701 transaction.data = "rg: 00-09 rg: 10-19 ";
3702 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
3757 MockTransaction transaction(kRangeGET_TransactionOK);
3758 transaction.request_headers = EXTRA_HEADER;
3760 MockHttpRequest request(transaction);
3842 ScopedMockTransaction transaction(kSimpleGET_Transaction);
3843 transaction.test_mode |= (TEST_MODE_SYNC_CACHE_START |
3847 MockHttpRequest r1(transaction),
3848 r2(transaction),
3849 r3(transaction);
3883 // force this transaction to validate the cache
3884 MockTransaction transaction(kETagGET_Transaction);
3885 transaction.load_flags |= net::LOAD_VALIDATE_CACHE;
3886 RunTransactionTest(cache.http_cache(), transaction);
3923 // Destroy transaction when going out of scope. We have not actually
3951 // Destroy transaction when going out of scope. We have not actually
3962 ScopedMockTransaction transaction(kSimpleGET_Transaction);
3963 transaction.response_headers = "cache-control: no-store\n";
3966 RunTransactionTest(cache.http_cache(), transaction);
3973 RunTransactionTest(cache.http_cache(), transaction);
3981 cache.disk_cache()->OpenEntry(transaction.url, &entry, NULL));
3990 ScopedMockTransaction transaction(kETagGET_Transaction);
3993 RunTransactionTest(cache.http_cache(), transaction);
4000 transaction.load_flags = net::LOAD_VALIDATE_CACHE;
4001 transaction.response_headers = "cache-control: no-store\n";
4002 RunTransactionTest(cache.http_cache(), transaction);
4010 cache.disk_cache()->OpenEntry(transaction.url, &entry, NULL));
4019 ScopedMockTransaction transaction(kETagGET_Transaction);
4022 RunTransactionTest(cache.http_cache(), transaction);
4029 transaction.load_flags = net::LOAD_VALIDATE_CACHE;
4030 transaction.response_headers = "cache-control: no-store\n";
4031 transaction.status = "HTTP/1.1 304 Not Modified";
4032 RunTransactionTest(cache.http_cache(), transaction);
4040 cache.disk_cache()->OpenEntry(transaction.url, &entry, NULL));
4047 MockTransaction transaction = kSimpleGET_Transaction;
4048 transaction.cert_status = net::CERT_STATUS_REVOKED;
4049 ScopedMockTransaction scoped_transaction(transaction);
4052 RunTransactionTest(cache.http_cache(), transaction);
4055 transaction.load_flags |= net::LOAD_ONLY_FROM_CACHE;
4057 MockHttpRequest request(transaction);
4093 // force this transaction to write to the cache again
4094 MockTransaction transaction(kSimpleGET_Transaction);
4096 RunTransactionTest(cache.http_cache(), transaction);