Home | History | Annotate | Download | only in http

Lines Matching refs:transaction

1141 // Tests that disk failures after the transaction has started don't cause the
1236 // force this transaction to read from the cache
1237 MockTransaction transaction(kSimpleGET_Transaction);
1238 transaction.load_flags |= net::LOAD_ONLY_FROM_CACHE;
1242 RunTransactionTestWithLog(cache.http_cache(), transaction, log.bound());
1273 // force this transaction to read from the cache
1274 MockTransaction transaction(kSimpleGET_Transaction);
1275 transaction.load_flags |= net::LOAD_ONLY_FROM_CACHE;
1277 MockHttpRequest request(transaction);
1303 // force this transaction to read from the cache if valid
1304 MockTransaction transaction(kSimpleGET_Transaction);
1305 transaction.load_flags |= net::LOAD_PREFERRING_CACHE;
1307 RunTransactionTest(cache.http_cache(), transaction);
1317 // force this transaction to read from the cache if valid
1318 MockTransaction transaction(kSimpleGET_Transaction);
1319 transaction.load_flags |= net::LOAD_PREFERRING_CACHE;
1321 RunTransactionTest(cache.http_cache(), transaction);
1334 // Force this transaction to write to the cache again.
1335 MockTransaction transaction(kSimpleGET_Transaction);
1336 transaction.load_flags |= net::LOAD_BYPASS_CACHE;
1343 RunTransactionTestWithLog(cache.http_cache(), transaction, log.bound());
1378 // force this transaction to write to the cache again
1379 MockTransaction transaction(kSimpleGET_Transaction);
1380 transaction.request_headers = "pragma: no-cache";
1382 RunTransactionTest(cache.http_cache(), transaction);
1395 // force this transaction to write to the cache again
1396 MockTransaction transaction(kSimpleGET_Transaction);
1397 transaction.request_headers = "cache-control: no-cache";
1399 RunTransactionTest(cache.http_cache(), transaction);
1415 // force this transaction to validate the cache
1416 MockTransaction transaction(kSimpleGET_Transaction);
1417 transaction.load_flags |= net::LOAD_VALIDATE_CACHE;
1419 RunTransactionTest(cache.http_cache(), transaction);
1435 // force this transaction to validate the cache
1436 MockTransaction transaction(kSimpleGET_Transaction);
1437 transaction.request_headers = "cache-control: max-age=0";
1439 RunTransactionTest(cache.http_cache(), transaction);
1458 MockTransaction transaction(kSimpleGET_Transaction);
1459 transaction.handler = PreserveRequestHeaders_Handler;
1460 transaction.request_headers = EXTRA_HEADER;
1461 transaction.response_headers = "Cache-Control: max-age=0\n";
1462 AddMockTransaction(&transaction);
1465 RunTransactionTest(cache.http_cache(), transaction);
1466 RunTransactionTest(cache.http_cache(), transaction);
1471 RemoveMockTransaction(&transaction);
1481 MockTransaction transaction(kETagGET_Transaction);
1482 transaction.handler = PreserveRequestHeaders_Handler;
1483 transaction.request_headers = "If-None-Match: \"foopy\"\r\n"
1485 AddMockTransaction(&transaction);
1487 RunTransactionTest(cache.http_cache(), transaction);
1492 RemoveMockTransaction(&transaction);
1613 // the queue to move to the next transaction. Now we cancel the request that
1673 // Cancel the first queued transaction.
1689 // transaction to said entry.
1771 // Destroy only the first transaction.
1941 // Test that destroying the transaction while it is reading from the cache
1946 // HttpCache::Transaction::OnCacheReadCompleted.
2074 // Complete the last transaction.
2129 // Now let's queue a regular transaction
2193 ScopedMockTransaction transaction(kETagGET_Transaction);
2196 RunTransactionTest(cache.http_cache(), transaction);
2204 transaction.load_flags = net::LOAD_VALIDATE_CACHE;
2205 transaction.handler = ETagGet_ConditionalRequest_Handler;
2206 RunTransactionTest(cache.http_cache(), transaction);
2228 ScopedMockTransaction transaction(kETagGET_Transaction);
2231 RunTransactionTest(cache.http_cache(), transaction);
2239 transaction.load_flags = net::LOAD_VALIDATE_CACHE;
2240 transaction.handler = ETagGet_ConditionalRequest_NoStore_Handler;
2241 RunTransactionTest(cache.http_cache(), transaction);
2761 MockTransaction transaction(kSimplePOST_Transaction);
2762 transaction.load_flags |= net::LOAD_ONLY_FROM_CACHE;
2764 MockHttpRequest request(transaction);
2789 MockTransaction transaction(kSimplePOST_Transaction);
2793 MockHttpRequest request(transaction);
2799 RunTransactionTestWithRequest(cache.http_cache(), transaction, request, NULL);
2807 RunTransactionTestWithRequest(cache.http_cache(), transaction, request, NULL);
2827 MockTransaction transaction(kSimpleGET_Transaction);
2828 transaction.request_headers = "If-None-Match: foo";
2829 RunTransactionTest(cache.http_cache(), transaction);
2835 transaction.request_headers =
2837 RunTransactionTest(cache.http_cache(), transaction);
2849 MockTransaction transaction(kRangeGET_Transaction);
2850 transaction.request_headers = "If-None-Match: foo\r\n"
2853 RunTransactionTest(cache.http_cache(), transaction);
2859 transaction.request_headers =
2863 RunTransactionTest(cache.http_cache(), transaction);
2869 transaction.request_headers = "If-Range: bla\r\n"
2872 RunTransactionTest(cache.http_cache(), transaction);
2884 MockTransaction transaction(kRangeGET_TransactionOK);
2885 AddMockTransaction(&transaction);
2886 transaction.request_headers = EXTRA_HEADER;
2887 transaction.handler = NULL;
2888 RunTransactionTest(cache.http_cache(), transaction);
2895 RunTransactionTest(cache.http_cache(), transaction);
2900 RemoveMockTransaction(&transaction);
2909 MockTransaction transaction(kRangeGET_TransactionOK);
2910 AddMockTransaction(&transaction);
2911 transaction.response_headers = "Content-Length: 10\n"
2913 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
2929 RemoveMockTransaction(&transaction);
2957 // Make sure we are done with the previous transaction.
2961 MockTransaction transaction(kRangeGET_TransactionOK);
2962 transaction.request_headers = "Range: bytes = 30-39\r\n" EXTRA_HEADER;
2963 transaction.data = "rg: 30-39 ";
2964 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
2971 // Make sure we are done with the previous transaction.
2975 transaction.request_headers = "Range: bytes = 20-59\r\n" EXTRA_HEADER;
2976 transaction.data = "rg: 20-29 rg: 30-39 rg: 40-49 rg: 50-59 ";
2977 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
2992 MockTransaction transaction(kRangeGET_TransactionOK);
2993 transaction.test_mode = TEST_MODE_SYNC_ALL;
2994 AddMockTransaction(&transaction);
2998 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
3006 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
3013 // Make sure we are done with the previous transaction.
3017 transaction.request_headers = "Range: bytes = 30-39\r\n" EXTRA_HEADER;
3018 transaction.data = "rg: 30-39 ";
3019 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
3026 // Make sure we are done with the previous transaction.
3030 transaction.request_headers = "Range: bytes = 20-59\r\n" EXTRA_HEADER;
3031 transaction.data = "rg: 20-29 rg: 30-39 rg: 40-49 rg: 50-59 ";
3032 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
3039 RemoveMockTransaction(&transaction);
3048 MockTransaction transaction(kRangeGET_TransactionOK);
3049 transaction.response_headers =
3055 AddMockTransaction(&transaction);
3056 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
3064 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
3072 transaction.load_flags |= net::LOAD_VALIDATE_CACHE;
3073 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
3080 RemoveMockTransaction(&transaction);
3089 MockTransaction transaction(kRangeGET_TransactionOK);
3090 transaction.response_headers =
3096 AddMockTransaction(&transaction);
3097 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
3105 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
3112 RemoveMockTransaction(&transaction);
3133 MockTransaction transaction(kRangeGET_TransactionOK);
3134 transaction.load_flags |= net::LOAD_VALIDATE_CACHE;
3135 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
3163 MockTransaction transaction(kRangeGET_TransactionOK);
3164 transaction.load_flags |= net::LOAD_VALIDATE_CACHE;
3165 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
3189 MockTransaction transaction(kRangeGET_TransactionOK);
3190 transaction.request_headers = "Range: bytes = -10\r\n" EXTRA_HEADER;
3191 transaction.data = "rg: 70-79 ";
3192 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
3199 // Make sure we are done with the previous transaction.
3203 transaction.request_headers = "Range: bytes = 60-\r\n" EXTRA_HEADER;
3204 transaction.data = "rg: 60-69 rg: 70-79 ";
3205 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
3222 MockTransaction transaction(kRangeGET_TransactionOK);
3223 transaction.test_mode = TEST_MODE_SYNC_CACHE_START |
3226 AddMockTransaction(&transaction);
3229 transaction.request_headers = "Range: bytes = 70-\r\n" EXTRA_HEADER;
3230 transaction.data = "rg: 70-79 ";
3231 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
3238 // Make sure we are done with the previous transaction.
3242 transaction.request_headers = "Range: bytes = -20\r\n" EXTRA_HEADER;
3243 transaction.data = "rg: 60-69 rg: 70-79 ";
3244 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
3251 RemoveMockTransaction(&transaction);
3260 MockTransaction transaction(kRangeGET_TransactionOK);
3261 AddMockTransaction(&transaction);
3267 transaction.request_headers = "Range: bytes = 70-\r\n" EXTRA_HEADER;
3268 transaction.data = "";
3269 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
3277 RunTransactionTest(cache.http_cache(), transaction);
3280 RemoveMockTransaction(&transaction);
3299 MockTransaction transaction(kRangeGET_TransactionOK);
3300 transaction.request_headers = EXTRA_HEADER;
3301 transaction.data = "rg: 00-09 rg: 10-19 rg: 20-29 rg: 30-39 rg: 40-49 "
3303 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
3318 MockTransaction transaction(kRangeGET_TransactionOK);
3319 AddMockTransaction(&transaction);
3323 transaction.request_headers = "Range: bytes = 0-9\r\n" EXTRA_HEADER;
3324 transaction.data = "rg: 00-09 ";
3325 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
3329 transaction.request_headers = "Range: bytes = 70-79\r\n" EXTRA_HEADER;
3330 transaction.data = "rg: 70-79 ";
3331 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
3339 transaction.load_flags |= net::LOAD_VALIDATE_CACHE;
3340 transaction.request_headers = "Foo: bar\r\n" EXTRA_HEADER;
3341 transaction.data = "rg: 00-09 rg: 10-19 rg: 20-29 rg: 30-39 rg: 40-49 "
3343 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
3350 RemoveMockTransaction(&transaction);
3361 MockTransaction transaction(kRangeGET_TransactionOK);
3362 transaction.request_headers = "Range: bytes = 0-9\r\n" EXTRA_HEADER;
3363 transaction.data = "rg: 00-09 ";
3364 transaction, &headers);
3389 RunTransactionTest(cache.http_cache(), transaction);
3392 RemoveMockTransaction(&transaction);
3528 MockTransaction transaction(kTypicalGET_Transaction);
3529 transaction.url = kRangeGET_TransactionOK.url;
3530 transaction.data = "rg: 00-09 rg: 10-19 rg: 20-29 rg: 30-39 rg: 40-49 "
3532 AddMockTransaction(&transaction);
3533 RunTransactionTest(cache.http_cache(), transaction);
3538 RemoveMockTransaction(&transaction);
3554 // The last transaction has finished so make sure the entry is deactivated.
3600 MockTransaction transaction(kRangeGET_TransactionOK);
3601 transaction.request_headers = "Range: bytes = -10\r\n" EXTRA_HEADER;
3602 transaction.data = "rg: 70-79 ";
3603 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
3649 MockTransaction transaction(kRangeGET_TransactionOK);
3650 transaction.request_headers = "Range: bytes = 120-\r\n" EXTRA_HEADER;
3651 transaction.data = "";
3652 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
3692 // Destroy the transaction.
3732 // Destroy the transaction before completing the read.
3736 // message loop. This means that a new transaction will just reuse the same
3777 // Destroy the transaction before completing the read.
3781 // message loop. This means that a new transaction will just reuse the same
3795 // The new transaction is waiting for the query range callback.
3812 MockTransaction transaction(kRangeGET_TransactionOK);
3813 transaction.handler = NULL;
3814 transaction.response_headers = "Content-Range: bytes 40-49/45\n"
3816 AddMockTransaction(&transaction);
3817 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
3819 std::string expected(transaction.status);
3821 expected.append(transaction.response_headers);
3840 MockTransaction transaction(kRangeGET_TransactionOK);
3841 transaction.handler = NULL;
3842 transaction.response_headers = "Content-Range: bytes 40-49/80\n"
3844 AddMockTransaction(&transaction);
3845 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
3847 std::string expected(transaction.status);
3849 expected.append(transaction.response_headers);
3869 MockTransaction transaction(kRangeGET_TransactionOK);
3870 transaction.handler = NULL;
3871 transaction.request_headers = "Range: bytes = 50-59\r\n" EXTRA_HEADER;
3872 std::string response_headers(transaction.response_headers);
3874 transaction.response_headers = response_headers.c_str();
3875 AddMockTransaction(&transaction);
3876 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
3883 RemoveMockTransaction(&transaction);
3886 // This transaction will report a resource size of 80 bytes, and we think it's
3916 MockTransaction transaction(kRangeGET_TransactionOK);
3917 transaction.handler = NULL;
3918 transaction.request_headers = "Range: bytes = 4294967288-4294967297\r\n"
3920 transaction.response_headers =
3924 AddMockTransaction(&transaction);
3925 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
3927 std::string expected(transaction.status);
3929 expected.append(transaction.response_headers);
3963 MockTransaction transaction(kRangeGET_TransactionOK);
3964 transaction.request_headers = "Range: bytes = -10\r\n" EXTRA_HEADER;
3965 transaction.method = "HEAD";
3966 transaction.data = "rg: 70-79 ";
3969 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
3984 MockTransaction transaction(kRangeGET_TransactionOK);
3985 transaction.request_headers = "Range: bytes = 40-\r\n" EXTRA_HEADER;
3986 transaction.test_mode = TEST_MODE_SYNC_NET_START;
3987 transaction.load_flags |= net::LOAD_VALIDATE_CACHE;
3988 AddMockTransaction(&transaction);
3996 transaction.data = "Not a range";
3997 RunTransactionTest(cache.http_cache(), transaction);
4003 RemoveMockTransaction(&transaction);
4012 MockTransaction transaction(kRangeGET_TransactionOK);
4013 transaction.request_headers = "Range: bytes = 40-49\r\n" EXTRA_HEADER;
4014 transaction.data = "rg: 40-"; // Less than expected.
4015 transaction.handler = NULL;
4016 std::string headers(transaction.response_headers);
4018 transaction.response_headers = headers.c_str();
4020 AddMockTransaction(&transaction);
4023 RunTransactionTest(cache.http_cache(), transaction);
4031 transaction.request_headers = "Range: bytes = 60-69\r\n" EXTRA_HEADER;
4032 transaction.data = "rg: 60-"; // Less than expected.
4035 transaction.response_headers = headers.c_str();
4037 RunTransactionTest(cache.http_cache(), transaction);
4043 RemoveMockTransaction(&transaction);
4058 // Force this transaction to read from the cache.
4059 MockTransaction transaction(kRangeGET_TransactionOK);
4060 transaction.load_flags |= net::LOAD_ONLY_FROM_CACHE;
4062 MockHttpRequest request(transaction);
4155 // Destroy the transaction. We only have the headers so we should delete this
4192 // Destroy the transaction.
4207 MockTransaction transaction(kSimpleGET_Transaction);
4208 transaction.response_headers =
4213 AddMockTransaction(&transaction);
4214 MockHttpRequest request(transaction);
4235 // Destroy the transaction.
4244 RemoveMockTransaction(&transaction);
4251 MockTransaction transaction(kSimpleGET_Transaction);
4252 transaction.response_headers =
4256 AddMockTransaction(&transaction);
4257 MockHttpRequest request(transaction);
4278 // We want to cancel the request when the transaction is busy.
4285 // Destroy the transaction.
4291 // could end up with the transaction being deleted twice if we send any
4292 // notification from the transaction destructor (see http://crbug.com/31723).
4304 RemoveMockTransaction(&transaction);
4321 MockTransaction transaction(kRangeGET_TransactionOK);
4322 transaction.request_headers = EXTRA_HEADER;
4323 transaction.data = "rg: 00-09 rg: 10-19 rg: 20-29 rg: 30-39 rg: 40-49 "
4325 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
4369 MockTransaction transaction(kRangeGET_TransactionOK);
4370 transaction.request_headers = EXTRA_HEADER;
4371 transaction.data = "Not a range";
4372 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
4406 MockTransaction transaction(kRangeGET_TransactionOK);
4407 transaction.request_headers = EXTRA_HEADER;
4408 transaction.data = "rg: 00-09 rg: 10-19 rg: 20-29 rg: 30-39 rg: 40-49 "
4414 MockHttpRequest request(transaction);
4440 MockTransaction transaction(kRangeGET_TransactionOK);
4441 transaction.request_headers = EXTRA_HEADER;
4442 transaction.data = "Not a range";
4445 RunTransactionTestWithResponse(cache.http_cache(), transaction, &headers);
4478 MockTransaction transaction(kRangeGET_TransactionOK);
4479 transaction.request_headers = EXTRA_HEADER;
4481 MockHttpRequest request(transaction);
4547 ScopedMockTransaction transaction(kSimpleGET_Transaction);
4548 transaction.test_mode |= (TEST_MODE_SYNC_CACHE_START |
4552 MockHttpRequest r1(transaction),
4553 r2(transaction),
4554 r3(transaction);
4588 // force this transaction to validate the cache
4589 MockTransaction transaction(kETagGET_Transaction);
4590 transaction.load_flags |= net::LOAD_VALIDATE_CACHE;
4591 RunTransactionTest(cache.http_cache(), transaction);
4628 // Destroy transaction when going out of scope. We have not actually
4656 // Destroy transaction when going out of scope. We have not actually
4667 ScopedMockTransaction transaction(kSimpleGET_Transaction);
4668 transaction.response_headers = "cache-control: no-store\n";
4671 RunTransactionTest(cache.http_cache(), transaction);
4678 RunTransactionTest(cache.http_cache(), transaction);
4685 EXPECT_FALSE(cache.OpenBackendEntry(transaction.url, &entry));
4694 ScopedMockTransaction transaction(kETagGET_Transaction);
4697 RunTransactionTest(cache.http_cache(), transaction);
4704 transaction.load_flags = net::LOAD_VALIDATE_CACHE;
4705 transaction.response_headers = "cache-control: no-store\n";
4706 RunTransactionTest(cache.http_cache(), transaction);
4713 EXPECT_FALSE(cache.OpenBackendEntry(transaction.url, &entry));
4722 ScopedMockTransaction transaction(kETagGET_Transaction);
4725 RunTransactionTest(cache.http_cache(), transaction);
4732 transaction.load_flags = net::LOAD_VALIDATE_CACHE;
4733 transaction.response_headers = "cache-control: no-store\n";
4734 transaction.status = "HTTP/1.1 304 Not Modified";
4735 RunTransactionTest(cache.http_cache(), transaction);
4742 EXPECT_FALSE(cache.OpenBackendEntry(transaction.url, &entry));
4749 MockTransaction transaction = kSimpleGET_Transaction;
4750 transaction.cert_status = net::CERT_STATUS_REVOKED;
4751 ScopedMockTransaction scoped_transaction(transaction);
4754 RunTransactionTest(cache.http_cache(), transaction);
4757 transaction.load_flags |= net::LOAD_ONLY_FROM_CACHE;
4759 MockHttpRequest request(transaction);
4795 // force this transaction to write to the cache again
4796 MockTransaction transaction(kSimpleGET_Transaction);
4798 RunTransactionTest(cache.http_cache(), transaction);
4968 // Start with a READ mode transaction.