~unity-api-team/unity-scopes-api/child-scopes-option

« back to all changes in this revision

Viewing changes to test/gtest/scopes/internal/smartscopes/SmartScopesClient/SmartScopesClient_test.cpp

  • Committer: Marcus Tomlinson
  • Date: 2014-10-08 10:58:57 UTC
  • mfrom: (497.1.3 devel)
  • mto: (497.1.5 devel)
  • mto: This revision was merged to the branch mainline in revision 505.
  • Revision ID: marcus.tomlinson@canonical.com-20141008105857-gf4ilb9ywfeaeroi
Merged devel

Show diffs side-by-side

added added

removed removed

Lines of Context:
140
140
        dept = deptinfo;
141
141
    };
142
142
 
143
 
    auto search_handle = ssc_->search(handler, sss_url_ + "/demo", "stuff", "", "session_id", 0, "platform");
 
143
    auto search_handle = ssc_->search(handler, sss_url_ + "/demo", "stuff", "", "session_id", 0, "platform", VariantMap(), VariantMap(), "en_US", "", "ThisIsUserAgentHeader");
144
144
    search_handle->wait();
145
145
 
146
146
    ASSERT_EQ(3u, results.size());
221
221
    EXPECT_EQ(active_option->id(), "salesrank");
222
222
}
223
223
 
 
224
TEST_F(SmartScopesClientTest, userAgentHeader)
 
225
{
 
226
    std::vector<SearchResult> results;
 
227
 
 
228
    SearchReplyHandler handler;
 
229
    handler.filters_handler = [](Filters const &) {
 
230
    };
 
231
    handler.filter_state_handler = [](FilterState const&) {
 
232
    };
 
233
    handler.category_handler = [](std::shared_ptr<SearchCategory> const&) {
 
234
    };
 
235
    handler.result_handler = [&results](SearchResult const& result) {
 
236
        results.push_back(result);
 
237
    };
 
238
    handler.departments_handler = [](std::shared_ptr<DepartmentInfo> const&) {
 
239
    };
 
240
 
 
241
    auto search_handle = ssc_->search(handler, sss_url_ + "/demo", "test_user_agent_header", "", "session_id", 0, "platform", VariantMap(), VariantMap(), "en_US", "", "ThisIsUserAgentHeader");
 
242
    search_handle->wait();
 
243
 
 
244
    ASSERT_EQ(4u, results.size());
 
245
 
 
246
    // user agent string is expected in the result title
 
247
    EXPECT_EQ("ThisIsUserAgentHeader", results[3].other_params["title"]->as_string());
 
248
}
 
249
 
224
250
TEST_F(SmartScopesClientTest, preview)
225
251
{
226
252
    PreviewReplyHandler handler;